/* ============================================================================
   Rui Codex Monitoring — Design System (light + dark)
   Replaces the inline style blocks that previously lived in _Layout.cshtml and
   _AuthLayout.cshtml. Every color flows through the tokens below; the active
   theme is selected with <html data-theme="light|dark"> (data-bs-theme is kept
   in sync by theme.js so Bootstrap components follow along).

   Legacy variable names (--primary-color, --glass-border, --glass-bg,
   --sidebar-text, --sidebar-active) are preserved as aliases because per-view
   inline styles reference them directly.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------- */
:root {
    --sidebar-width: 280px;
    --header-height: 65px;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 10px;
}

:root,
[data-theme="light"] {
    /* Surfaces */
    --bg-body: #eef0e6;              /* soft sage canvas */
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;          /* dropdowns, toasts, modals */
    --bg-input: #f5f6f8;
    --bg-input-focus: #ffffff;
    --bg-hover: #f2f4f7;
    --bg-active: rgba(99, 102, 241, 0.08);
    --bg-thead: #f8f9fb;

    /* Text */
    --text-heading: #101529;
    --text-primary: #1c2136;
    --text-secondary: #667085;
    --text-muted: #98a2b3;
    --text-invert: #ffffff;

    /* Brand */
    --primary: #6366f1;
    --primary-strong: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.10);
    --grad-primary: linear-gradient(135deg, #6366f1, #8b5cf6);

    /* Status */
    --success: #16a34a;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #b45309;
    --warning-soft: rgba(234, 179, 8, 0.15);
    --danger: #dc2626;
    --danger-soft: rgba(239, 68, 68, 0.10);
    --info: #0e7490;
    --info-soft: rgba(6, 182, 212, 0.12);

    /* Lines & shadows */
    --border: #e5e8ee;
    --border-strong: #d5dae4;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 28px -18px rgba(16, 24, 40, 0.14);
    --shadow-card-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 16px 36px -18px rgba(16, 24, 40, 0.20);
    --shadow-pop: 0 12px 32px -12px rgba(16, 24, 40, 0.25);

    /* Background blobs */
    --blob-1: #c7d2fe;
    --blob-2: #bbf7d0;
    --blob-3: #a5f3fc;
    --blob-opacity: 0.45;

    /* Scrollbar */
    --scroll-track: transparent;
    --scroll-thumb: #cdd3de;
    --scroll-thumb-hover: #b6bdcb;

    /* Legacy aliases (referenced by per-view inline styles) */
    --primary-color: #6366f1;
    --primary-hover: #8b5cf6;        /* second gradient stop, not a hover shade */
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: #e5e8ee;
    --sidebar-text: #667085;
    --sidebar-active: #101529;
}

[data-theme="dark"] {
    /* Surfaces */
    --bg-body: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-elevated: #1b2338;
    --bg-input: rgba(15, 23, 42, 0.55);
    --bg-input-focus: rgba(15, 23, 42, 0.85);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-active: rgba(99, 102, 241, 0.15);
    --bg-thead: rgba(0, 0, 0, 0.2);

    /* Text */
    --text-heading: #f8fafc;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-invert: #ffffff;

    /* Brand */
    --primary: #6366f1;
    --primary-strong: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.15);
    --grad-primary: linear-gradient(135deg, #6366f1, #a855f7);

    /* Status */
    --success: #4ade80;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #facc15;
    --warning-soft: rgba(234, 179, 8, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #22d3ee;
    --info-soft: rgba(6, 182, 212, 0.12);

    /* Lines & shadows */
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Background blobs */
    --blob-1: #6366f1;
    --blob-2: #a855f7;
    --blob-3: #3b82f6;
    --blob-opacity: 0.4;

    /* Scrollbar */
    --scroll-track: #0f172a;
    --scroll-thumb: #334155;
    --scroll-thumb-hover: #475569;

    /* Legacy aliases */
    --primary-color: #6366f1;
    --primary-hover: #a855f7;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
}

/* ---------------------------------------------------------------------------
   2. Theme change — circular reveal (View Transitions API) + fallback fade
   --------------------------------------------------------------------------- */
/* The transition overlay must not swallow clicks while the (deliberately slow)
   3.5s ripple plays — without this the whole UI is unclickable during it. */
::view-transition {
    pointer-events: none;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 0; }
::view-transition-new(root) { z-index: 1; }

/* Fallback / smoothing for browsers without View Transitions.
   Explicit allowlist — a universal selector here would fight the ripple. */
body,
.sidebar,
.sidebar-brand,
.main-header,
.card,
.card-header,
.stat-card,
.glass-card,
.dropdown-menu,
.dropdown-item,
.form-control,
.form-select,
.nav-link,
.table,
.table th,
.table td,
.page-link,
.btn,
.alert,
.modal-content,
.toast,
.list-group-item,
.badge {
    transition: background-color 0.4s ease, color 0.4s ease,
                border-color 0.4s ease, box-shadow 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
    body, .sidebar, .card, .stat-card, .glass-card {
        transition: none;
    }
}

/* ---------------------------------------------------------------------------
   3. Theme switch (pill with light / dark / system)
   --------------------------------------------------------------------------- */
.theme-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 34px);
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.theme-switch::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 34px;
    height: calc(100% - 8px);
    border-radius: 999px;
    background: var(--grad-primary);
    box-shadow: 0 6px 16px -10px rgba(99, 102, 241, 0.9);
    transition: transform 0.38s cubic-bezier(0.65, 0, 0.35, 1);
}

.theme-switch[data-choice="dark"]::before   { transform: translateX(34px); }
.theme-switch[data-choice="system"]::before { transform: translateX(68px); }

.theme-switch button {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.25s ease;
    padding: 0;
}

.theme-switch button:hover { color: var(--text-secondary); }
.theme-switch button[aria-pressed="true"] { color: #ffffff; }

/* Fixed placement variant used on auth pages */
.theme-switch.theme-switch-fixed {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1050;
}

/* ---------------------------------------------------------------------------
   4. Base
   --------------------------------------------------------------------------- */
* {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Animated background blobs */
.bg-shape {
    position: fixed;
    filter: blur(120px);
    opacity: var(--blob-opacity);
    animation: float 20s infinite alternate;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    transition: background-color 0.4s ease, opacity 0.4s ease;
}

.shape-1 { background: var(--blob-1); width: 500px; height: 500px; top: -100px; left: -100px; animation-delay: 0s; }
.shape-2 { background: var(--blob-2); width: 600px; height: 600px; bottom: -200px; right: -100px; animation-delay: -5s; }
.shape-3 { background: var(--blob-3); width: 400px; height: 400px; top: 40%; left: 40%; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(150px, 100px) rotate(180deg); }
}

.fade-in {
    animation: contentFadeIn 0.35s ease both;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-shape { animation: none; }
    .fade-in { animation: none; }
}

/* ---------------------------------------------------------------------------
   5. Sidebar
   --------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-brand h4 {
    color: var(--text-heading);
    margin: 0;
    font-weight: 700;
    font-size: 1.25rem;
}

[data-theme="dark"] .sidebar-brand h4 {
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--grad-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.sidebar-brand .brand-icon i {
    color: #fff;
    font-size: 1.25rem;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
    padding-bottom: 80px; /* room for footer */
    flex: 1 1 auto;
}

.sidebar-menu .menu-header {
    padding: 0.75rem 0.75rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-menu .nav-link {
    padding: 0.6rem 0.75rem;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: var(--radius-xs);
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.925rem;
}

.sidebar-menu .nav-link:hover {
    color: var(--sidebar-active);
    background: var(--bg-hover);
}

.sidebar-menu .nav-link.active {
    color: var(--primary-strong);
    background: var(--primary-soft);
}

[data-theme="dark"] .sidebar-menu .nav-link.active {
    color: var(--sidebar-active);
}

.sidebar-menu .nav-link i {
    font-size: 1.15rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-thead);
    width: 100%;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   6. Main content & header
   --------------------------------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.main-header .header-icon-btn {
    color: var(--text-secondary);
}
.main-header .header-icon-btn:hover {
    color: var(--text-heading);
}

.main-header .search-box {
    position: relative;
    width: 300px;
}

.main-header .search-box input {
    padding-left: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.main-header .search-box input:focus {
    background: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.main-header .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary) !important;
}

.user-dropdown .dropdown-toggle:hover {
    background: var(--bg-hover);
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .user-name {
    color: var(--text-heading);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.dropdown-menu {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-pop);
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .dropdown-menu {
    backdrop-filter: blur(20px);
}

.dropdown-item {
    color: var(--text-secondary);
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-heading);
}

.content-wrapper {
    padding: 2rem 1.5rem;
}

/* ---------------------------------------------------------------------------
   7. Cards & stat cards
   --------------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease,
                background-color 0.4s ease, color 0.4s ease;
}

[data-theme="dark"] .card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease,
                background-color 0.4s ease, border-color 0.4s ease;
}

[data-theme="dark"] .stat-card {
    backdrop-filter: blur(20px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-card.primary .stat-icon { background: var(--primary-soft); color: var(--primary-strong); }
.stat-card.success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card.danger .stat-icon  { background: var(--danger-soft);  color: var(--danger); }
.stat-card.info .stat-icon    { background: var(--info-soft);    color: var(--info); }

/* ---------------------------------------------------------------------------
   8. Legacy utility-class compatibility
   Views written against SB-Admin / light Bootstrap use these classes; they are
   remapped to tokens so they read correctly in BOTH themes.
   --------------------------------------------------------------------------- */
.text-gray-800 { color: var(--text-heading) !important; }
.text-gray-900 { color: var(--text-heading) !important; }
.text-muted    { color: var(--text-secondary) !important; }
.text-dark     { color: var(--text-heading) !important; }

/* Bootstrap's colored-badge idiom (`bg-warning text-dark` etc.): the ink must
   stay dark on saturated backgrounds in BOTH themes — the dark theme's
   .text-dark remap above would otherwise put near-white on yellow/cyan. */
.text-dark.bg-warning, .text-dark.bg-info, .text-dark.bg-success,
.text-dark.bg-danger, .text-dark.bg-primary, .text-dark.bg-secondary {
    color: #101529 !important;
}

.bg-white, .bg-light {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light {
    backdrop-filter: blur(10px);
}

/* Headings inherit the heading ink */
h1, h2, h3, h4, h5, h6,
.page-header h1 {
    color: var(--text-heading);
}

/* ---------------------------------------------------------------------------
   9. Alerts
   --------------------------------------------------------------------------- */
.alert {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm);
}
.alert-info    { background: var(--info-soft) !important;    border-color: rgba(6, 182, 212, 0.25) !important;  color: var(--info) !important; }
.alert-success { background: var(--success-soft) !important; border-color: rgba(34, 197, 94, 0.25) !important;  color: var(--success) !important; }
.alert-warning { background: var(--warning-soft) !important; border-color: rgba(234, 179, 8, 0.3) !important;   color: var(--warning) !important; }
.alert-danger  { background: var(--danger-soft) !important;  border-color: rgba(239, 68, 68, 0.25) !important;  color: var(--danger) !important; }
.alert-light   { background: var(--bg-card) !important;      border-color: var(--border) !important;            color: var(--text-primary) !important; }

/* ---------------------------------------------------------------------------
   10. Buttons
   --------------------------------------------------------------------------- */
.btn-primary {
    background: var(--grad-primary);
    border: none;
    border-radius: var(--radius-xs);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
    color: #fff;
    background: var(--grad-primary);
}

.btn-outline-primary {
    color: var(--primary-strong);
    border-color: var(--primary);
    border-radius: var(--radius-xs);
}

.btn-outline-primary:hover {
    background: var(--primary-soft);
    border-color: var(--primary-strong);
    color: var(--primary-strong);
}

/* ---------------------------------------------------------------------------
   11. Tables & DataTables
   --------------------------------------------------------------------------- */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: var(--bg-hover);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}
.table th {
    color: var(--text-secondary);
    border-bottom-color: var(--border);
    background: var(--bg-thead) !important;
    border-top: none;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.table td {
    border-bottom-color: var(--border);
    background: transparent !important;
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-secondary);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-link {
    background-color: var(--bg-card);
    border-color: var(--border);
    color: var(--primary-strong);
}
.page-link:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--primary-strong);
}
.page-item.disabled .page-link {
    background-color: var(--bg-input);
    border-color: var(--border);
    color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   12. Forms
   --------------------------------------------------------------------------- */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ---------------------------------------------------------------------------
   13. Modals, toasts, SweetAlert2
   --------------------------------------------------------------------------- */
.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
}
.modal-header, .modal-footer {
    border-color: var(--border);
}

.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-toast {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-left-width: 4px !important;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-pop);
    min-width: 280px;
}
.app-toast.toast-success { border-left-color: var(--success) !important; }
.app-toast.toast-error   { border-left-color: var(--danger) !important; }
.app-toast.toast-warning { border-left-color: var(--warning) !important; }
.app-toast.toast-info    { border-left-color: var(--info) !important; }

[data-theme="dark"] .app-toast {
    backdrop-filter: blur(10px);
}

/* SweetAlert2 (loaded per-view from CDN) */
[data-theme="dark"] .swal2-popup {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container {
    color: var(--text-primary) !important;
}

/* ---------------------------------------------------------------------------
   14. Social icons (brand colors are theme-independent)
   --------------------------------------------------------------------------- */
.social-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}
.social-icon.facebook { background: #1877f2; }
.social-icon.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-icon.pinterest { background: #e60023; }
.social-icon.linkedin { background: #0a66c2; }
.social-icon.youtube { background: #ff0000; }
.social-icon.google, .social-icon.googlereview { background: #4285f4; }
.social-icon.wordpress { background: #21759b; }

/* ---------------------------------------------------------------------------
   15. Auth pages (previously _AuthLayout inline styles)
   --------------------------------------------------------------------------- */
.auth-body-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1000px;
}

.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    perspective: 1000px;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-card-hover);
    transition: transform 0.1s;
    transform-style: preserve-3d;
}

[data-theme="dark"] .glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-card:hover {
    border-color: var(--border-strong);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
    transform: translateZ(30px);
}

.auth-header .brand-icon {
    width: 64px;
    height: 64px;
    background: var(--grad-primary);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    position: relative;
    z-index: 1;
}

.auth-header .brand-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: var(--grad-primary);
    z-index: -1;
    opacity: 0.5;
    filter: blur(10px);
}

.auth-header .brand-icon i {
    font-size: 2rem;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-heading);
}

[data-theme="dark"] .auth-header h1 {
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.auth-body {
    transform: translateZ(20px);
}

.auth-wrapper .form-floating {
    margin-bottom: 1.5rem;
}

.auth-wrapper .form-floating > label {
    color: var(--text-secondary);
    padding: 1rem 1.25rem;
}

.auth-wrapper .form-floating > .form-control {
    padding: 1rem 1.25rem;
    height: calc(3.5rem + 2px);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.auth-wrapper .form-floating > .form-control:focus {
    background: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

.auth-wrapper .form-floating > .form-control:focus ~ label,
.auth-wrapper .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-strong);
    transform: scale(.85) translateY(-0.75rem) translateX(0.15rem);
}

.input-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 5;
}

.form-control:focus + .input-icon {
    color: var(--primary);
}

.auth-wrapper .btn-primary {
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
    transform: translateZ(30px);
}

.auth-wrapper .btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.auth-wrapper .btn-primary:hover {
    transform: translateY(-2px) translateZ(30px);
    box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5);
}

.auth-wrapper .btn-primary:hover::after {
    left: 150%;
}

.auth-wrapper .form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-strong);
}

.auth-wrapper .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.auth-wrapper .form-check-label {
    color: var(--text-secondary);
}

.version-badge {
    position: absolute;
    bottom: 2rem;
    text-align: center;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    z-index: 10;
}

.input-group-relative {
    position: relative;
}

/* Autofill fix — per theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-input-focus) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------------------------------------------------------------------------
   16. Responsive & scrollbar
   --------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
