/* S9 Interiors Premium Custom Styling (Emulating Luxury Black-Orange Concept) */

/* --- Design System CSS Tokens --- */
:root {
    --brand-primary: #FF4F0F;
    --brand-primary-hover: #e0440b;
    --brand-primary-light: rgba(255, 79, 15, 0.08);
    --brand-primary-glow: rgba(255, 79, 15, 0.3);
    
    /* Light Mode Theme Colors (Sleek Warm Off-white & High-end Gray) */
    --bg-light-main: #f5f6f8;
    --bg-light-panel: #ffffff;
    --border-light: rgba(226, 232, 240, 0.8);
    --shadow-light: 0 12px 30px -10px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

.dark {
    /* Dark Mode Theme Colors (Deep Slate Backdrop & Glass Panels) */
    --bg-dark-main: #07090e;
    --bg-dark-panel: rgba(18, 25, 41, 0.7);
    --border-dark: rgba(255, 255, 255, 0.05);
    --shadow-dark: 0 30px 60px -15px rgba(0, 0, 0, 0.5), 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

/* --- Base Body & Scrollbar Upgrades --- */
body {
    background-color: var(--bg-light-main) !important;
    font-family: var(--font-body) !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.015em;
}

.dark body {
    background-color: var(--bg-dark-main) !important;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}
.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Keyframe Animations --- */
@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 79, 15, 0.45);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 79, 15, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 79, 15, 0);
    }
}

/* Apply load animations to primary cards and content grid */
.fi-main-ctn, .fi-section, .fi-wi-stats-overview-stat-card {
    animation: slide-up-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Floating Black Capsule Sidebar (Matching Mockup) --- */
@media (min-width: 1024px) {
    .fi-sidebar {
        height: calc(100vh - 2rem) !important;
        margin: 1rem 0 1rem 1rem !important;
        border-radius: 28px !important;
        background-color: #0c0d12 !important; /* Rich solid dark sidebar */
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    }
    
    .dark .fi-sidebar {
        background-color: #030407 !important;
        border: 1px solid rgba(255, 255, 255, 0.03) !important;
    }

    .fi-sidebar-header {
        background-color: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Emulate the orange circle logo from mockup */
    .fi-sidebar-header .fi-logo, .fi-sidebar-header a {
        color: #ffffff !important;
        font-weight: 700 !important;
        letter-spacing: -0.02em;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .fi-sidebar-header .fi-logo::before {
        content: 'S9';
        background: var(--brand-primary);
        color: #ffffff;
        font-size: 11px;
        font-weight: 800;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 0 12px var(--brand-primary-glow);
    }
}

/* Sidebar navigation links */
.fi-sidebar-item-button {
    color: #94a3b8 !important; /* Sleek slate gray text */
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1) !important;
    border-radius: 12px !important;
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 3px;
}

.fi-sidebar-item-button:hover {
    transform: translateX(4px);
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #ffffff !important;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    transform: rotate(6deg) scale(1.1);
    color: var(--brand-primary) !important;
}

/* Active sidebar item - Pill shape highlighted in orange (Matching Mockup) */
.fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px -2px var(--brand-primary-glow) !important;
}

.fi-sidebar-item.fi-active .fi-sidebar-item-button .fi-sidebar-item-icon,
.fi-sidebar-item.fi-active .fi-sidebar-item-button .fi-sidebar-item-label {
    color: #ffffff !important;
}

/* --- Topbar Header & Theme Switcher Pill --- */
.fi-topbar {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--border-light) !important;
    box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.02) !important;
}

.dark .fi-topbar {
    background-color: rgba(11, 17, 30, 0.75) !important;
    border-bottom: 1px solid var(--border-dark) !important;
    box-shadow: 0 4px 30px -10px rgba(0, 0, 0, 0.3) !important;
}

.fi-topbar .fi-theme-switcher {
    background: rgba(226, 232, 240, 0.6) !important;
    padding: 3px !important;
    border-radius: 9999px !important;
    border: 1px solid var(--border-light) !important;
    margin-right: 0.75rem !important;
    backdrop-filter: blur(8px);
    display: inline-flex !important;
    align-items: center;
    gap: 1px;
}

.dark .fi-topbar .fi-theme-switcher {
    background: rgba(30, 41, 59, 0.45) !important;
    border: 1px solid var(--border-dark) !important;
}

.fi-topbar .fi-theme-switcher-btn {
    border-radius: 9999px !important;
    padding: 0.35rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-topbar .fi-theme-switcher-btn svg {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fi-topbar .fi-theme-switcher-btn:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.fi-topbar .fi-theme-switcher-btn.fi-active {
    background: #ffffff !important;
    color: var(--brand-primary) !important;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.1) !important;
}

.dark .fi-topbar .fi-theme-switcher-btn.fi-active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ff8c5a !important;
    box-shadow: none !important;
}

/* --- Cards & Sections (Luxury Rounded Off-white Aesthetic) --- */
.fi-section, .fi-card, .fi-ta-ctn {
    background-color: var(--bg-light-panel) !important;
    border-radius: 24px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-light) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
}

.dark .fi-section, .dark .fi-card, .dark .fi-ta-ctn {
    background-color: var(--bg-dark-panel) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid var(--border-dark) !important;
    box-shadow: var(--shadow-dark) !important;
}

/* Smooth float scaling on cards */
.fi-wi-stats-overview-stat-card:hover, .fi-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 40px -10px rgba(15, 23, 42, 0.07), 0 8px 18px -4px rgba(15, 23, 42, 0.03) !important;
}

.dark .fi-wi-stats-overview-stat-card:hover, .dark .fi-section:hover {
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.75) !important;
    border-color: rgba(255, 79, 15, 0.2) !important;
}

/* Stats Overview Card Glowing indicator line */
.fi-wi-stats-overview-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px !important;
}

.fi-wi-stats-overview-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--brand-primary), #ff8c5a);
}

/* --- Premium Table & Grid Layouts --- */
.fi-ta-header-cell {
    background-color: rgba(248, 250, 252, 0.5) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.725rem !important;
    letter-spacing: 0.06em !important;
    color: #475569 !important;
    padding: 1.15rem 1.25rem !important;
}

.dark .fi-ta-header-cell {
    background-color: rgba(15, 23, 42, 0.25) !important;
    color: #94a3b8 !important;
}

.fi-ta-row {
    transition: all 0.2s ease !important;
}

.fi-ta-row:hover {
    background-color: rgba(248, 250, 252, 0.95) !important;
    transform: scale(1.002);
}

.dark .fi-ta-row:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.fi-ta-row td {
    padding: 1.15rem 1.25rem !important;
    border-bottom: 1px solid rgba(241, 245, 249, 0.7) !important;
}

.dark .fi-ta-row td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

/* --- Forms, Fields and Inputs --- */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    border-radius: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    padding: 0.625rem 0.875rem !important;
    transition: all 0.2s ease-in-out !important;
}

.dark input:not([type="checkbox"]):not([type="radio"]), .dark select, .dark textarea {
    background-color: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px var(--brand-primary-glow) !important;
    outline: none !important;
}

/* Checkboxes - Square styling */
input[type="checkbox"] {
    border-radius: 4px !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    padding: 0 !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    transition: all 0.2s ease !important;
}

.dark input[type="checkbox"] {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

input[type="checkbox"]:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px var(--brand-primary-glow) !important;
}

/* Radio buttons - Circular styling */
input[type="radio"] {
    border-radius: 9999px !important;
    padding: 0 !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dark input[type="radio"] {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

input[type="radio"]:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px var(--brand-primary-glow) !important;
}

/* --- Gorgeous Buttons with Glow & Pulse Effect --- */
.fi-btn-color-primary, button[type="submit"] {
    background: linear-gradient(to right, var(--brand-primary), #ff743b) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    animation: pulse-glow 3s infinite;
}

.fi-btn-color-primary:hover, button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -3px var(--brand-primary-glow) !important;
}

.fi-btn-color-primary:active, button[type="submit"]:active {
    transform: translateY(1px);
}

/* --- Gorgeous Premium Login Portal --- */
.fi-simple-layout {
    background: radial-gradient(circle at 10% 20%, rgba(255, 79, 15, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(255, 140, 90, 0.04) 0%, transparent 45%),
                var(--bg-light-main) !important;
}

.dark .fi-simple-layout {
    background: radial-gradient(circle at 10% 20%, rgba(255, 79, 15, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(255, 140, 90, 0.06) 0%, transparent 45%),
                #030509 !important;
}

.fi-simple-page {
    background-color: var(--bg-light-panel) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.15) !important;
    border-radius: 24px !important;
    padding: 2.5rem 3rem !important;
    transition: all 0.3s ease;
}

.dark .fi-simple-page {
    background-color: var(--bg-dark-panel) !important;
    border: 1px solid var(--border-dark) !important;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6) !important;
}
