/* ==========================================
   CINEMATIC DARK MECHANIC THEME
   Carbon & Metallic Dark with Racing Orange Accent
   ========================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --bg-carbon: #f3f4f6;
    --bg-metal: #ffffff;
    --bg-gray: #e5e7eb;
    --accent-orange: #c03b00;
    --accent-orange-hover: #a83300;
    --silver-text: #374151;
    --white-text: #111827;
    --shadow-glow: rgba(192, 59, 0, 0.08);
}

/* Base Reset & Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-carbon);
}

body {
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-carbon);
    color: var(--silver-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Headings */
h1, h2, h3, h4, h5, h6, .font-bebas {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
    color: var(--white-text) !important;
}

/* Base Layout Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 75vh;
}

@media (min-width: 640px) {
    .container {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2.5rem 2rem;
    }
}

/* Custom Utilities & Components */
.glow-button {
    background-color: var(--accent-orange);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--shadow-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-button:hover {
    background-color: var(--accent-orange-hover);
    box-shadow: 0 6px 20px rgba(255, 90, 0, 0.3);
    transform: translateY(-1px);
}

/* Standard Form Fields Styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    background-color: var(--bg-metal);
    color: var(--white-text) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

input, select, textarea {
    color: var(--white-text) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 2px rgba(255, 90, 0, 0.2);
}

/* Generic Table Styling (For Cart/History pages) */
.table-container {
    width: 100%;
    overflow-x: auto;
    background-color: var(--bg-metal);
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--white-text);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    font-size: 0.875rem;
    text-transform: uppercase;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    font-size: 0.875rem;
    color: var(--silver-text);
}

tr:last-child td {
    border-bottom: none;
}

/* Card General Styling */
.card-premium {
    background-color: var(--bg-metal);
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-premium:hover {
    border-color: rgba(255, 90, 0, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(255, 90, 0, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-carbon);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* Override Tailwind's semi-transparent white borders & dividers for light theme */
*[class*="border-white/"], *[class*="border-white\\/"] {
    border-color: rgba(0, 0, 0, 0.08) !important;
}
*[class*="divide-white/"], *[class*="divide-white\\/"] > * + * {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Prevent text from turning white when hovered on light backgrounds (high-specificity overrides) */
body *[class*="hover:bg-darkGray"]:hover, 
body *[class*="hover:bg-darkCarbon"]:hover,
body *[class*="hover:bg-darkMetal"]:hover {
    color: var(--white-text) !important;
}
body .group:hover .group-hover\:text-white {
    color: var(--white-text) !important;
}

/* Ensure secondary buttons/links with dark backgrounds (rendered light) have dark text in normal state */
body a[class*="bg-darkCarbon"]:not(:hover),
body a[class*="bg-darkGray"]:not(:hover),
body a[class*="bg-darkMetal"]:not(:hover) {
    color: var(--white-text) !important;
}

/* Ensure interactive hover states (Tailwind hover/group-hover classes) can override heading and text-white colors */
body h1:hover, body h2:hover, body h3:hover, body h4:hover, body h5:hover, body h6:hover, body .font-bebas:hover,
body *[class*="hover:text-accentOrange"]:hover,
body .group:hover .group-hover\:text-accentOrange,
body .group:hover .group-hover\:text-accentOrangeHover,
body *[class*="hover:text-accentOrangeHover"]:hover {
    color: var(--accent-orange) !important;
}

/* Override body .text-white to ensure readability on white backgrounds, excluding buttons/badges */
body .text-white:not(
    .bg-accentOrange *, 
    .bg-accentOrangeHover *, 
    .bg-red-500 *, 
    .bg-emerald-500 *, 
    .bg-blue-500 *, 
    .bg-amber-500 *,
    .glow-button *,
    [class*="bg-accentOrange"] *,
    [class*="bg-red-"] *,
    [class*="bg-emerald-"] *,
    [class*="bg-blue-"] *,
    [class*="bg-amber-"] *,
    button,
    a[class*="bg-"],
    .badge,
    .btn
) {
    color: var(--white-text) !important;
}

/* Override Generic Gray Text for Contrast Accessibility */
body .text-gray-300 {
    color: var(--silver-text) !important;
}
body .text-gray-400 {
    color: var(--silver-text) !important;
}

/* Fix Hover Invisibility on any element using hover:text-white */
/* This rule forces dark text (var(--white-text) which is a dark gray) on hover */
body *[class*="hover:text-white"]:hover {
    color: var(--white-text) !important;
}
