/* ============================================================
   JOBARA - Custom Styles
   Apply. Prove. Work. Grow.
   ============================================================ */

:root {
    --primary: #1e6bff;
    --primary-dark: #0b1f3a;
    --brand-blue: #1e6bff;
    --brand-navy: #0b1f3a;
    --dark: #0b1f3a;
    --sidebar-width: 280px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.brand-logo {
    height: auto;
    max-height: 72px;
    width: auto;
    max-width: min(220px, 100%);
    object-fit: contain;
    object-position: left center;
    display: inline-block;
}

.navbar-logo-wrap,
.sidebar-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: min(160px, 42vw);
    max-height: 40px;
    overflow: hidden;
    flex-shrink: 1;
}

.navbar-brand-logo,
.sidebar-brand-logo,
.footer-brand-logo {
    height: auto;
    width: auto;
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
    display: block;
    vertical-align: middle;
}

.hero-brand-logo {
    height: auto;
    width: auto;
    max-height: 96px;
    max-width: min(260px, 70vw);
    object-fit: contain;
    object-position: center;
    margin-bottom: 1rem;
}

.logo-admin-preview {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-admin-preview-img {
    max-width: 100%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.favicon-admin-preview-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Responsive ad containers — never break layout */
.ad-slot {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 1.25rem 0;
    clear: both;
}

.ad-slot-inner {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-slot-inner iframe,
.ad-slot-inner img,
.ad-slot-inner > div {
    max-width: 100% !important;
}

@media (max-width: 991.98px) {
    .navbar-logo-wrap,
    .sidebar-logo-wrap {
        max-width: min(140px, 38vw);
        max-height: 34px;
    }
    .navbar-brand-logo,
    .sidebar-brand-logo,
    .footer-brand-logo {
        max-height: 32px;
    }
}

@media (max-width: 576px) {
    .brand-logo { max-height: 56px; }
    .hero-brand-logo { max-height: 72px; }
    .navbar-logo-wrap,
    .sidebar-logo-wrap {
        max-width: min(120px, 46vw);
        max-height: 28px;
    }
    .navbar-brand-logo,
    .sidebar-brand-logo,
    .footer-brand-logo {
        max-height: 28px;
    }
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, #1e6bff 0%, #154fc4 45%, #0b1f3a 100%);
    min-height: 300px;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-tagline {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e6bff 0%, #154fc4 45%, #0b1f3a 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

/* ===== Dashboard Layout ===== */
.dashboard-body {
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.dashboard-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dashboard-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-nav .nav-link {
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff !important;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ===== Stat Cards ===== */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ===== Notification Dropdown ===== */
.notification-menu {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown {
    width: 320px;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
}

/* ===== Progress Bars ===== */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ===== Test Timer ===== */
.test-timer {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
    font-variant-numeric: tabular-nums;
}

/* ===== File Upload ===== */
.file-upload-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
}

/* ===== Cards ===== */
.card {
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    padding: 12px 20px;
}

/* ===== Tables ===== */
.table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom-width: 1px;
}

/* ===== Badges ===== */
.badge {
    font-weight: 500;
}

/* ===== Alerts ===== */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

/* ===== Legal Content ===== */
.legal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.legal-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 991.98px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }

    .dashboard-sidebar.show {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .auth-card {
        padding: 25px;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        min-height: 250px;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .notification-menu {
        width: 280px;
    }

    .table-responsive {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Prevent layout breakers */
.dashboard-main,
main,
.table-responsive,
.auth-card {
    max-width: 100%;
}

.navbar-brand {
    max-width: calc(100% - 60px);
}

/* ===== Print ===== */
@media print {
    .dashboard-sidebar,
    .dashboard-topbar,
    .btn {
        display: none !important;
    }

    .dashboard-main {
        margin-left: 0;
    }
}