/* EvA Gold Task Portal - Comprehensive Mobile-First & Desktop CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #FF7F00; /* EvA Orange */
    --primary-hover: #E67300;
    --secondary: #4CAF50; /* EvA Green */
    --bg-dark: #090d16; /* Deep modern navy midnight */
    --card-dark: #1e293b;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --success: #10B981;
    --danger: #EF4444;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

.eva-logo-text { 
    font-family: 'Inter', sans-serif; 
    font-weight: 800; 
    font-size: 24px; 
    letter-spacing: -0.5px; 
}

/* Authentication Screens (Login & Register) */
.auth-container { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    padding: 20px 16px; 
    background: radial-gradient(circle at 50% -20%, #1e293b, #090d16 70%); 
}

.auth-card { 
    background: var(--card-dark); 
    padding: 36px 32px; 
    border-radius: 16px; 
    width: 100%; 
    max-width: 440px; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6); 
    border: 1px solid rgba(255,255,255,0.06); 
    backdrop-filter: blur(12px); 
}

.auth-card h2 { 
    text-align: center; 
    margin-bottom: 24px; 
    font-size: 24px; 
    color: white; 
}

.form-group { 
    margin-bottom: 18px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    color: var(--text-muted); 
    font-size: 13px; 
    font-weight: 500; 
}

.form-control { 
    width: 100%; 
    padding: 12px 16px; 
    background: rgba(15, 23, 42, 0.7); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    color: white; 
    font-size: 14px; 
    transition: all 0.25s ease; 
}

.form-control:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(255, 127, 0, 0.2); 
    background: rgba(15, 23, 42, 0.95); 
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), #FF9800); 
    color: white; 
    border: none; 
    padding: 13px 20px; 
    width: 100%; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 14px;
    cursor: pointer; 
    transition: all 0.25s ease; 
    box-shadow: 0 4px 12px rgba(255, 127, 0, 0.25); 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary:hover { 
    transform: translateY(-1px); 
    box-shadow: 0 6px 16px rgba(255, 127, 0, 0.35); 
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Application Layout Structure */
.admin-wrapper { 
    display: flex; 
    min-height: 100vh; 
    width: 100%;
    position: relative;
}

.admin-sidebar { 
    width: 260px; 
    background: #0f172a; 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    z-index: 100; 
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.sidebar-brand { 
    padding: 20px 18px; 
    border-bottom: 1px solid var(--border); 
    text-align: center; 
}

.sidebar-menu { 
    list-style: none; 
    padding: 16px 0; 
    flex: 1; 
    overflow-y: auto; 
}

.sidebar-menu li a { 
    display: flex; 
    align-items: center; 
    padding: 13px 22px; 
    color: var(--text-muted); 
    text-decoration: none; 
    transition: 0.2s; 
    font-size: 14px; 
    font-weight: 500; 
    border-left: 3px solid transparent; 
}

.sidebar-menu li a:hover, .sidebar-menu li a.active { 
    color: white; 
    background: rgba(255, 127, 0, 0.08); 
    border-left-color: var(--primary); 
}

.sidebar-menu li a i { 
    margin-right: 12px; 
    font-size: 16px; 
    width: 20px;
    text-align: center;
}

.admin-main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0;
    background: #090d16; 
}

.admin-header { 
    height: 68px; 
    background: rgba(15, 23, 42, 0.85); 
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 24px; 
    position: sticky; 
    top: 0; 
    z-index: 50; 
}

.admin-content { 
    padding: 24px; 
    flex: 1; 
    min-width: 0;
}

/* Dashboard Statistics & Cards */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 20px; 
    margin-bottom: 24px; 
}

.stat-card { 
    background: var(--card-dark); 
    padding: 20px; 
    border-radius: 14px; 
    border: 1px solid rgba(255,255,255,0.06); 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
    transition: transform 0.2s, box-shadow 0.2s; 
}

.stat-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.25); 
}

.stat-icon { 
    width: 52px; 
    height: 52px; 
    border-radius: 12px; 
    background: rgba(255, 127, 0, 0.1); 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 22px; 
    flex-shrink: 0;
}

.stat-info h4 { 
    color: var(--text-muted); 
    font-size: 13px; 
    font-weight: 500; 
    margin-bottom: 4px; 
}

.stat-info h2 { 
    color: white; 
    font-size: 24px; 
    font-weight: 700; 
    letter-spacing: -0.5px; 
}

/* Alerts */
.alert { 
    padding: 12px 16px; 
    border-radius: 10px; 
    margin-bottom: 20px; 
    font-size: 13px; 
    font-weight: 500; 
}

.alert-error { 
    background: rgba(239, 68, 68, 0.12); 
    color: #FCA5A5; 
    border: 1px solid rgba(239, 68, 68, 0.3); 
}

/* Tables with horizontal scroll safety */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
}

th { 
    padding: 14px 16px; 
    text-align: left; 
    color: var(--text-muted); 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 11px; 
    letter-spacing: 0.5px; 
    border-bottom: 1px solid var(--border); 
    background: rgba(0,0,0,0.25); 
    white-space: nowrap;
}

td { 
    padding: 14px 16px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

tr:hover td { 
    background: rgba(255,255,255,0.02); 
}

/* Developer Footer */
.dev-footer { 
    margin-top: auto; 
    padding: 16px 20px; 
    background: #080c16; 
    border-top: 1px solid var(--border); 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 13px; 
}

/* Mobile Toggle Hamburger Button & Overlay */
.mobile-sidebar-toggle {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    margin-right: 12px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Bottom App Navigation Bar for Mobile */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    height: 100%;
}

.mobile-bottom-nav a.active, .mobile-bottom-nav a:hover {
    color: var(--primary);
}

.mobile-bottom-nav a i {
    font-size: 16px;
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES (100% Mobile & Tablet Perfection)
   ======================================================== */
@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        display: inline-flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-sidebar.show-mobile {
        left: 0;
    }

    .admin-main {
        width: 100%;
        min-height: 100vh;
        padding-bottom: 70px; /* Space for mobile bottom nav bar */
    }

    .admin-header {
        padding: 0 16px;
        height: 60px;
    }

    .admin-content {
        padding: 16px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .stat-card {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 14px;
    }

    .auth-card h2 {
        font-size: 20px;
    }

    /* Ad Viewer Mobile Adjustments */
    .ad-header {
        height: auto !important;
        padding: 10px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .ad-viewport {
        height: calc(100vh - 120px) !important;
    }
}

@media (max-width: 480px) {
    .eva-logo-text {
        font-size: 20px;
    }

    .form-control {
        font-size: 13px;
        padding: 11px 14px;
    }

    .btn-primary {
        padding: 12px 16px;
        font-size: 13px;
    }
}
