/* assets/css/dashboard.css */
:root {
    --header-height: 60px;
    --nav-background: var(--surface-0);
    --nav-border: var(--border);
    --nav-text: var(--text);
    --nav-hover-bg: var(--surface-1);
    --link-active: var(--primary);
}

body {
    background: var(--surface-background);
    padding-top: var(--header-height); /* Offset for fixed header */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
}

.main-header {
    background: var(--nav-background);
    border-bottom: 1px solid var(--nav-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
}

.logo-img { height: 32px; }
.logo-text { font-size: 1.25rem; font-weight: 600; margin-left: 0.5rem; display: none; }

.main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(248, 250, 252, 0.98); /* opaque-ish light background */
    backdrop-filter: blur(2px);
    border-bottom: 1px solid var(--nav-border);
}
.main-nav.active { display: flex; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--nav-text);
    border-bottom: 1px solid var(--nav-border);
}
.nav-link:last-child { border-bottom: none; }

.user-area { display: none; }

.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0;
}
.mobile-menu-toggle .material-symbols-outlined { font-size: 2rem; }

/* Page Header */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}
.page-header h1 { margin: 0; }
.header-actions { display: flex; align-items: center; gap: 1rem; width: 100%; }
.header-actions .push-right { margin-left: auto; }
.wallet-display { display: flex; align-items: center; gap: 0.5rem; background: var(--surface-1); padding: 0.25rem 0.75rem; border-radius: 1.5rem; }
.recharge-btn { color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; }

.btn-sm {
    display: inline-block;
    padding: .25rem .6rem;
    border: 1px solid var(--border);
    border-radius: .35rem;
    text-decoration: none;
    font-size: 0.875rem;
}
.btn-sm:hover{background:#e5e7eb;}
.btn-learn{color:#0b5; border-color:#0b5;}
.btn-activities{color:#06c; border-color:#06c;}
.btn-practice{color:#a50; border-color:#a50;}
.btn-testing{color:#b00; border-color:#b00;}
.btn-advanced{color:#633; border-color:#633;}

/* Course Grid & Cards */
.courses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.course-card {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}
.course-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.course-card-header h3 { margin: 0; }
.course-card-header h3 a { color: var(--text); text-decoration: none; }
.course-badges { margin-top: 0.5rem; display: flex; gap: 0.5rem; }
.course-badges .badge { font-size: 1.25rem; }

.unit-block { margin: 1rem; }
.unit-title { font-weight: 600; margin-bottom: 0.5rem; font-family: "Bookman Old Style", "Times New Roman", serif; }
.course-card-body .chapter-title { font-family: "Bookman Old Style", "Times New Roman", serif; }

/* Footer */
.main-footer {
    background: var(--surface-1);
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    margin-top: auto;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { text-decoration: none; color: var(--text-muted); }

/* Ensure Material Icons are outlined black and uniform */
.material-symbols-outlined { color: #000; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24; vertical-align: middle; }

/* Page loader (do/index.php) */
.dp-page-loader { position: fixed; inset: 0; background: rgba(255,255,255,.95); display: none; align-items: center; justify-content: center; z-index: 1050; }
.dp-page-loader.show { display: flex; }
.dp-page-loader-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dp-page-loader .loading-text { font-weight: 600; color: var(--text); }
.dp-page-loader .dots span { opacity: 0; animation: dotBlink 1s infinite; }
.dp-page-loader .dots span:nth-child(1) { animation-delay: 0s; }
.dp-page-loader .dots span:nth-child(2) { animation-delay: .2s; }
.dp-page-loader .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBlink { 0%{opacity:0} 50%{opacity:1} 100%{opacity:0} }

/* Reuse gear animations */
.gears-loader { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.gear { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; will-change: transform; animation: dp-spin 1.1s linear infinite; }
.gear.small { width: 26px; height: 26px; animation: dp-spin-rev 0.9s linear infinite; }
.gear .material-symbols-outlined { font-size: 100%; font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24; }
@keyframes dp-spin { to { transform: rotate(360deg); } }
@keyframes dp-spin-rev { to { transform: rotate(-360deg); } }

/* Tablet and Desktop styles */
@media (min-width: 768px) {
    .logo-text { display: inline; }
    .mobile-menu-toggle { display: none; }
    
    .main-nav {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        border: none;
        gap: 0.5rem;
    }
    .nav-link {
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        border: none;
    }
    .nav-link .nav-text { display: none; }

    .user-area {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .sign-out-link { color: var(--nav-text); text-decoration: none; }
    
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .courses-grid { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
    
    .footer-content { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1024px) {
    .nav-link .nav-text { display: inline; }
}
