/* public/assets/css/style.css - Phase 1: Midnight Gold Luxury Theme */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600&family=Rubik:wght@300;400;500;700;900&display=swap');

:root {
    /* --- Midnight Gold Palette --- */

    /* Backgrounds */
    --bg-body: #0f172a;
    /* Deep Night Blue */
    --bg-sidebar: #020617;
    /* Darker Night */
    --bg-surface: #1e293b;
    /* Card Surface */
    --bg-glass: rgba(30, 41, 59, 0.7);
    /* Glass Effect */

    /* Accents */
    --primary: #fbbf24;
    /* Gold/Amber */
    --primary-hover: #f59e0b;
    --primary-glow: rgba(251, 191, 36, 0.3);

    --accent-blue: #38bdf8;
    /* Cyan for secondary actions */

    /* Text */
    --text-main: #f1f5f9;
    /* Pearl White */
    --text-muted: #94a3b8;
    /* Silver Grey */
    --text-dark: #0f172a;
    /* For text on Gold buttons */

    /* Status Colors (Neon Style) */
    --status-success: #34d399;
    /* Emerald Neon */
    --status-danger: #f87171;
    /* Red Neon */
    --status-warning: #fbbf24;
    /* Amber Neon */

    /* Borders & Shadows */
    --border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(251, 191, 36, 0.15);
    /* Gold Glow */

    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    --radius: 16px;
}

body {
    font-family: 'Heebo', sans-serif;
    background-color: var(--bg-body);
    /* Subtle mesh gradient background */
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 191, 36, 0.05) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

.ltr {
    direction: ltr;
    display: inline-block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* === Layout === */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    height: 90px;
    display: flex;
    align-items: center;
    padding: 0 30px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    /* Gold Text */
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.sidebar-header i {
    margin-left: 12px;
    font-size: 1.1em;
    color: var(--text-main);
}

.sidebar-nav {
    padding: 30px 15px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 8px;
    color: var(--text-muted);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 400;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.nav-item i {
    width: 24px;
    margin-left: 15px;
    text-align: center;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), transparent);
    color: var(--primary);
    border-right: 3px solid var(--primary);
    border-color: transparent var(--primary) transparent transparent;
    /* Right border handled above */
    font-weight: 500;
}

.nav-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}


/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.top-bar {
    height: 90px;
    background: rgba(15, 23, 42, 0.8);
    /* Dark Glass */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title h2 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 300;
    /* Thin & Elegant */
    color: var(--text-main);
}

.page-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}


/* === Cards (Dark Glass) === */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* Top Highlight Line */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.card-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(251, 191, 36, 0.3);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Outfit', monospace;
    /* Monospace for numbers */
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* === Tables (Floating Rows) === */
.table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    /* Spacing between rows */
}

thead th {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 10px 25px;
    border: none;
    letter-spacing: 1px;
}

tbody tr {
    background: var(--bg-surface);
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

tbody tr:hover {
    transform: scale(1.01);
    background: #2a3850;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
    position: relative;
}

td {
    padding: 20px 25px;
    border: none;
    color: var(--text-main);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Rounded Corners for Rows */
td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-right: 1px solid var(--border);
}

td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-left: 1px solid var(--border);
}

td a {
    color: var(--accent-blue);
    font-weight: 500;
    border-bottom: 1px dashed rgba(56, 189, 248, 0.3);
}

td a:hover {
    color: white;
    border-bottom-style: solid;
}

/* Fonts - Premium Hebrew Selection */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600&family=Rubik:wght@300;400;500;700;900&display=swap');

body {
    font-family: 'Assistant', sans-serif;
    /* Clean, modern body text */
}

h1,
h2,
h3,
h4,
h5,
h6,
.stat-value,
.sidebar-header,
.card-header {
    font-family: 'Rubik', sans-serif;
    /* Strong, geometric headings */
}

/* === Buttons - Premium Gold (The "Royal" Look) === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    border-radius: 6px;
    /* Slightly sharper for premium feel */
    font-weight: 700;
    font-family: 'Rubik', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: none;
    font-size: 1rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.btn-primary {
    /* Deep Gold Gradient */
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    /* Dark text for contrast */
    box-shadow:
        0 4px 15px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    /* Inner highlight */
    border: 1px solid #b45309;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(245, 158, 11, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Shine Effect on Hover */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(251, 191, 36, 0.05);
}

.form-control {
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 14px 20px;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

/* === Badges (Glowing) === */
.badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* === Mobile === */
.mobile-menu-btn {
    display: none;
    color: white;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        cursor: pointer;
    }

    .mobile-brand {
        display: flex !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: #020617;
        z-index: 100;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        right: 0;
    }

    .top-bar {
        padding: 10px 15px;
        height: 70px;
    }

    /* Smaller Title on Mobile */
    .page-title h2 {
        font-size: 1.2rem;
    }

    /* Show User Name but hide Role on Mobile */
    .user-info {
        display: flex;
        flex-direction: column;
        margin-right: 8px;
    }

    .user-role {
        display: none;
    }

    .user-name {
        font-size: 0.9rem;
    }

    .user-profile-widget {
        padding: 4px;
        border: none;
        background: transparent;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .page-content {
        padding: 15px;
        width: 100%;
    }

    /* Grid Layout for Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 20px;
    }

    /* Ensure Data Cards fit */
    .data-grid {
        grid-template-columns: 1fr !important;
    }
}

/* User Profile - Premium styling (Global) */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: var(--transition);
}

.user-profile-widget:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), #d97706);
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Rubik', sans-serif;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Online Indicator dot */
.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    box-shadow: 0 0 5px #10b981;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Data Grid/List Switcher === */
.view-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-btn {
    padding: 8px 12px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* === Card View Mode === */
.table-container.view-cards table,
.table-container.view-cards thead,
.table-container.view-cards tbody {
    display: none !important;
}

.table-container.view-cards .data-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.data-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Card Header Strip */
.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.card-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    /* Fixed label width, flexible value width */
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    text-align: right;
    /* Ensure content is right-aligned */
}

/* Specific override for the top header row (Status badge) */
.data-card .card-row:first-child {
    display: flex;
    /* Keep flex for the title row to push Badge to left */
    justify-content: space-between;
}

.card-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-val {
    font-weight: 500;
    color: var(--text-main);
}

/* === Recent Checks Dashboard (Responsive) === */
/* === Recent Checks Dashboard (Responsive) === */
.mobile-only-grid {
    display: none !important;
}

.desktop-only-table {
    display: table;
    width: 100%;
}

@media (max-width: 992px) {
    .desktop-only-table {
        display: none !important;
    }

    .mobile-only-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .table-container {
        padding: 0;
        border: none;
        overflow: visible;
        /* Prevent clipping of shadows */
    }
}

.clickable-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}