/* 233x Design System 2.0 - International Grade (Vercel/Linear Inspired) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Base Palette - Zinc (Neutral & Cool) */
    --bg-page: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #fafafa;
    --bg-surface-tertiary: #f4f4f5;

    --border-subtle: #e4e4e7;
    --border-default: #d4d4d8;

    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-tertiary: #a1a1aa;

    /* Accents - International Blue */
    --accent-primary: #000000;
    /* Primary actions are stark black in this aesthetic */
    --accent-brand: #2563eb;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    /* Metrics */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --nav-height: 64px;
}

/* Global Reset */
body {
    background-color: #fafafa !important;
    /* Slight off-white background */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.015em;
    /* Tight typography */
}

/* Component: App Header */
.app-header {
    min-height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .app-header .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--bg-surface);
        padding: 1rem;
        border-bottom: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        margin-top: 0;
        z-index: 1040;
        /* High z-index to overlay content */
    }
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
    background-color: var(--bg-surface-tertiary);
}

/* Component: Bento Grid Layout System */

/* Utilities Overrides for Auth Pages & General Usage */
.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.border-0 {
    border: none !important;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    padding: 2rem 0;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bento-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-default);
}

/* Specific Bento Areas */
.area-hero {
    grid-column: span 12;
}

.area-stats {
    grid-column: span 6;
}

/* Desktop: 6 cols (was 4) */
.area-sidebar {
    grid-column: span 6;
}

/* Desktop: 4 cols */

@media (max-width: 991.98px) {

    .area-stats,
    .area-sidebar {
        grid-column: span 12;
    }

    .bento-grid {
        gap: 1rem;
    }
}

/* Component: Typography */
.display-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Component: Terminal / Code Block */
.terminal-block {
    background: #18181b;
    /* Zinc 900 */
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: #e4e4e7;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-block .prefix {
    color: var(--text-secondary);
    user-select: none;
    margin-right: 0.5rem;
}

/* Component: Action Buttons */
.btn-action-primary {
    background: var(--accent-primary) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500 !important;
    padding: 0.5rem 1rem !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-action-primary:hover {
    background: #27272a !important;
    /* Zinc 800 */
    transform: translateY(-1px);
}

.btn-action-ghost {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
}

.btn-action-ghost:hover {
    background: var(--bg-surface-secondary) !important;
}

/* Component: Traffic Chart Overrides */
.apexcharts-tooltip {
    background: #18181b !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: var(--shadow-lg) !important;
}

.apexcharts-tooltip-title {
    background: #27272a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: 'Inter', sans-serif !important;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
    --bg-page: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-secondary: #171717;
    --bg-surface-tertiary: #262626;

    --border-subtle: #27272a;
    --border-default: #3f3f46;

    --text-primary: #ededed;
    --text-secondary: #a1a1aa;

    --accent-primary: #ffffff;
}

[data-bs-theme="dark"] body {
    background-color: var(--bg-page) !important;
}

[data-bs-theme="dark"] .app-header {
    background: rgba(0, 0, 0, 0.7) !important;
    border-bottom-color: var(--border-subtle);
}

[data-bs-theme="dark"] .display-title {
    background: linear-gradient(180deg, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-bs-theme="dark"] .btn-action-primary {
    background: white !important;
    color: black !important;
}

[data-bs-theme="dark"] .btn-action-primary:hover {
    background: #e4e4e7 !important;
}

/* Utility: Gradient Text */
.text-gradient-blue {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fix: Page Titles Visibility Override */
.page-title,
.page-header h2 {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
}

.page-pretitle {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Component: Page Header Decoration */
.page-header {
    border-left: 4px solid var(--accent-brand);
    padding-left: 1rem;
    margin-bottom: 2rem !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Ensure left alignment of the row */
}

/* Ensure row takes full width relative to the header container */
.page-header .row {
    width: 100%;
    margin-left: 0 !important;
    /* Reset negative margins if interfering */
    margin-right: 0 !important;
}

/* Unify spacing and alignment for all page titles */
.page-header .col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start !important;
    /* Force text to align left */
    height: 100%;
    text-align: left !important;
}

.page-header .page-title,
.page-header .page-pretitle,
.page-header h2,
.page-header span {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2;
    text-align: left !important;
}

.page-header .page-title {
    margin-bottom: 0.5rem !important;
    /* Consistent gap between title and subtitle */
    font-size: 20px !important;
    text-transform: uppercase;
}

.page-header .page-pretitle {
    font-size: 0.875rem !important;
    color: var(--text-secondary);
}

/* Fix specific template variance where my-3 is used */
.page-header .my-3 {
    margin: 0 !important;
}

/* =========================================
   Auth Pages: Split Screen Design
   ========================================= */

.auth-page-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-page);
    overflow: hidden;
}

/* Left/Top Visual Side */
@keyframes aurora-move {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.auth-visual-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000;
    /* Aurora Mesh Gradient */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(253, 16%, 7%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: aurora-move 15s ease infinite;
    position: relative;
    padding: 2rem;
    color: white;
    text-align: center;
}

/* Add a subtle texture or overlay if desired */
.auth-visual-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='1'/%3E%3Ccircle cx='13' cy='13' r='1'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.auth-brand-content {
    z-index: 10;
    max-width: 400px;
}

.auth-brand-logo {
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.auth-brand-quote {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.95);
}

.auth-brand-author {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Right/Bottom Form Side */
.auth-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--bg-page);
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
    /* Clean form, remove card feel if using split layout, or keep subtle */
}

/* Typography Overrides for Auth Form */
.auth-title {
    font-size: 1.875rem;
    /* 30px */
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Responsive: Mobile View */
@media (max-width: 991.98px) {
    .auth-page-wrapper {
        flex-direction: column;
    }

    .auth-visual-side {
        display: none;
        /* Hide visual branding on mobile to focus on task */
    }

    .auth-form-side {
        padding: 1.5rem;
        justify-content: flex-start;
        /* Start from top on mobile */
        padding-top: 4rem;
    }

    /* Ensure a small logo is visible on mobile form side since big one is hidden */
    .mobile-logo {
        display: block;
        margin-bottom: 2rem;
        text-align: center;
    }
}

@media (min-width: 992px) {
    .mobile-logo {
        display: none;
    }
}