/* ============================================================
   Student Dashboard Styles - Google/Modern LMS Style
   Color Theme: Dark Green (#1a5c38) and Gold (#c9a227)
   ============================================================ */

:root {
    --sd-green: #1a5c38;
    --sd-green-dark: #0f4a2a;
    --sd-green-light: #2a7a4a;
    --sd-gold: #c9a227;
    --sd-gold-light: #e8c44a;
    --sd-gold-dark: #a8821a;
    --sd-bg: #f4f6f9;
    --sd-card-bg: #ffffff;
    --sd-text: #2d3748;
    --sd-text-light: #718096;
    --sd-border: #e2e8f0;
    --sd-sidebar-width: 260px;
    --sd-topbar-height: 64px;
    --sd-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sd-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --sd-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --sd-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.08);
    --sd-radius: 12px;
}

/* ============ STUDENT DASHBOARD LAYOUT ============ */

/* Remove main padding from public site when in dashboard */
body.student-dashboard {
    background: var(--sd-bg);
    overflow-x: hidden;
}

body.student-dashboard main {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide public navbar when in dashboard mode - we use our own topbar */
body.student-dashboard .navbar:not(.sd-topbar),
body.student-dashboard .preloader {
    display: none;
}

/* ============ TOP BAR ============ */
.sd-topbar {
    position: fixed;
    top: 0;
    right: var(--sd-sidebar-width);
    left: 0;
    height: var(--sd-topbar-height);
    background: var(--sd-card-bg);
    border-bottom: 1px solid var(--sd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
    box-shadow: var(--sd-shadow);
    transition: var(--sd-transition);
}

.sd-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sd-topbar-left h5 {
    color: var(--sd-text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sd-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--sd-text);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--sd-transition);
}

.sd-sidebar-toggle:hover {
    background: var(--sd-bg);
    color: var(--sd-green);
}

/* ============ PROFILE AVATAR (Top Right) ============ */
.sd-profile-wrapper {
    position: relative;
}

.sd-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 50px;
    transition: var(--sd-transition);
    border: none;
    background: none;
}

.sd-profile-trigger:hover {
    background: var(--sd-bg);
}

.sd-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--sd-green);
    border: 2px solid var(--sd-green);
    transition: var(--sd-transition);
}

.sd-avatar-circle.has-image {
    border-color: var(--sd-gold);
}

.sd-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sd-profile-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sd-text);
    white-space: nowrap;
}

.sd-profile-chevron {
    font-size: 0.7rem;
    color: var(--sd-text-light);
    transition: var(--sd-transition);
}

.sd-profile-trigger[aria-expanded="true"] .sd-profile-chevron {
    transform: rotate(180deg);
}

/* Profile Dropdown */
.sd-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--sd-card-bg);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow-lg);
    border: 1px solid var(--sd-border);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--sd-transition);
    z-index: 1050;
}

.sd-profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sd-profile-dropdown .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--sd-border);
    margin-bottom: 4px;
}

.sd-profile-dropdown .dropdown-header strong {
    display: block;
    font-size: 0.9rem;
    color: var(--sd-text);
}

.sd-profile-dropdown .dropdown-header small {
    font-size: 0.8rem;
    color: var(--sd-text-light);
}

.sd-profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sd-text);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--sd-transition);
}

.sd-profile-dropdown a:hover {
    background: var(--sd-bg);
    color: var(--sd-green);
}

.sd-profile-dropdown a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--sd-text-light);
    transition: var(--sd-transition);
}

.sd-profile-dropdown a:hover i {
    color: var(--sd-green);
}

.sd-profile-dropdown a.dropdown-logout {
    border-top: 1px solid var(--sd-border);
    margin-top: 4px;
    color: #e53e3e;
}

.sd-profile-dropdown a.dropdown-logout:hover {
    background: #fff5f5;
}

.sd-profile-dropdown a.dropdown-logout i {
    color: #e53e3e;
}

/* ============ SIDEBAR ============ */
.sd-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sd-sidebar-width);
    background: linear-gradient(180deg, var(--sd-green-dark) 0%, var(--sd-green) 100%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    transition: var(--sd-transition);
    overflow: hidden;
}

.sd-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    min-height: var(--sd-topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sd-sidebar-brand img {
    width: 36px;
    height: 36px;
}

.sd-sidebar-brand span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.sd-sidebar-brand .brand-gold {
    color: var(--sd-gold);
}

.sd-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sd-sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sd-sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sd-sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    padding: 16px 12px 8px;
    font-weight: 600;
}

.sd-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    transition: var(--sd-transition);
    margin-bottom: 2px;
    position: relative;
}

.sd-sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--sd-transition);
}

.sd-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sd-sidebar-item:hover i {
    color: var(--sd-gold);
}

.sd-sidebar-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sd-sidebar-item.active i {
    color: var(--sd-gold);
}

.sd-sidebar-item.active::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--sd-gold);
    border-radius: 4px 0 0 4px;
}

.sd-sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sd-sidebar-footer .sd-sidebar-item {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.sd-sidebar-footer .sd-sidebar-item:hover {
    color: #fff;
}

.sd-sidebar-footer .sd-sidebar-item i {
    color: rgba(255, 255, 255, 0.4);
}

.sd-sidebar-footer .sd-sidebar-item:hover i {
    color: #e53e3e;
}

/* ============ MAIN CONTENT ============ */
.sd-content {
    margin-right: var(--sd-sidebar-width);
    margin-top: var(--sd-topbar-height);
    padding: 32px;
    min-height: calc(100vh - var(--sd-topbar-height));
    transition: var(--sd-transition);
}

.sd-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============ SIDEBAR OVERLAY (mobile) ============ */
.sd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sd-overlay.show {
    opacity: 1;
}

/* ============ CUSTOM CARDS ============ */
.sd-card {
    background: var(--sd-card-bg);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow);
    border: 1px solid var(--sd-border);
    transition: var(--sd-transition);
}

.sd-card:hover {
    box-shadow: var(--sd-shadow-md);
}

.sd-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sd-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sd-card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sd-text);
    margin: 0;
}

.sd-card-header h5 i {
    color: var(--sd-green);
    margin-right: 8px;
}

.sd-card-body {
    padding: 24px;
}

/* ============ WELCOME CARD ============ */
.sd-welcome-card {
    background: linear-gradient(135deg, var(--sd-green) 0%, var(--sd-green-dark) 100%);
    border-radius: var(--sd-radius);
    padding: 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.sd-welcome-card::before {
    content: '\f6d4';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 10rem;
    opacity: 0.06;
    color: var(--sd-gold);
}

.sd-welcome-card h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.sd-welcome-card p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 0.95rem;
}

.sd-welcome-card .sd-welcome-icon {
    color: var(--sd-gold);
    font-size: 2rem;
    margin-bottom: 12px;
}

/* ============ STATS CARDS ============ */
.sd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.sd-stat-card {
    background: var(--sd-card-bg);
    border-radius: var(--sd-radius);
    padding: 20px;
    border: 1px solid var(--sd-border);
    box-shadow: var(--sd-shadow);
    transition: var(--sd-transition);
    position: relative;
    overflow: hidden;
}

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

.sd-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.sd-stat-card .stat-icon.green {
    background: rgba(26, 92, 56, 0.1);
    color: var(--sd-green);
}

.sd-stat-card .stat-icon.gold {
    background: rgba(201, 162, 39, 0.12);
    color: var(--sd-gold);
}

.sd-stat-card .stat-icon.blue {
    background: rgba(66, 133, 244, 0.1);
    color: #4285f4;
}

.sd-stat-card .stat-icon.purple {
    background: rgba(128, 90, 213, 0.1);
    color: #805ad5;
}

.sd-stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--sd-text);
    line-height: 1.2;
}

.sd-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--sd-text-light);
    font-weight: 500;
    margin-top: 2px;
}

/* ============ COURSE CARDS ============ */
.sd-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sd-course-card {
    background: var(--sd-card-bg);
    border-radius: var(--sd-radius);
    border: 1px solid var(--sd-border);
    overflow: hidden;
    transition: var(--sd-transition);
    position: relative;
}

.sd-course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sd-shadow-md);
}

.sd-course-img {
    height: 160px;
    background: linear-gradient(135deg, var(--sd-green), var(--sd-green-light));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sd-course-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sd-course-img .no-image-icon {
    font-size: 3.5rem;
    color: var(--sd-gold);
    opacity: 0.6;
}

.sd-course-body {
    padding: 16px 20px 20px;
}

.sd-course-body .badge-status {
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: capitalize;
}

.sd-course-body h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sd-text);
    margin: 8px 0 4px;
    line-height: 1.3;
}

.sd-course-body .course-meta {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--sd-text-light);
    margin-bottom: 10px;
}

.sd-course-body .course-desc {
    font-size: 0.82rem;
    color: var(--sd-text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.sd-progress-bar-wrap {
    margin-bottom: 14px;
}

.sd-progress-bar-wrap .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.sd-progress-bar-wrap .progress-info span:first-child {
    color: var(--sd-text-light);
}

.sd-progress-bar-wrap .progress-info span:last-child {
    font-weight: 600;
    color: var(--sd-text);
}

.sd-progress {
    height: 6px;
    border-radius: 10px;
    background: var(--sd-bg);
    overflow: hidden;
}

.sd-progress .sd-progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--sd-green), var(--sd-green-light));
    transition: width 0.6s ease;
}

.sd-progress .sd-progress-bar.gold {
    background: linear-gradient(90deg, var(--sd-gold-dark), var(--sd-gold));
}

.sd-progress .sd-progress-bar.complete {
    background: linear-gradient(90deg, #38a169, #48bb78);
}

.sd-course-action {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--sd-gold);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: var(--sd-transition);
    cursor: pointer;
}

.sd-course-action:hover {
    background: var(--sd-gold-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

/* ============ ALERTS ============ */
.sd-alert {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sd-alert-success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #22543d;
}

.sd-alert-success i {
    color: #38a169;
}

.sd-alert-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #9b2c2c;
}

.sd-alert-error i {
    color: #e53e3e;
}

.sd-alert-info {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2a4365;
}

/* ============ EMPTY STATE ============ */
.sd-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.sd-empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 16px;
    display: block;
}

.sd-empty-state h5 {
    color: var(--sd-text-light);
    margin-bottom: 8px;
}

.sd-empty-state p {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ============ PROFILE FORM ============ */
.sd-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--sd-border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--sd-text);
    background: var(--sd-card-bg);
    transition: var(--sd-transition);
    outline: none;
}

.sd-form-control:focus {
    border-color: var(--sd-gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.sd-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sd-text);
    margin-bottom: 6px;
    display: block;
}

.sd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--sd-transition);
    text-decoration: none;
}

.sd-btn-primary {
    background: var(--sd-green);
    color: #fff;
}

.sd-btn-primary:hover {
    background: var(--sd-green-dark);
    box-shadow: 0 4px 12px rgba(26, 92, 56, 0.3);
}

.sd-btn-gold {
    background: var(--sd-gold);
    color: #fff;
}

.sd-btn-gold:hover {
    background: var(--sd-gold-dark);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.sd-btn-outline {
    background: transparent;
    border: 1.5px solid var(--sd-border);
    color: var(--sd-text);
}

.sd-btn-outline:hover {
    border-color: var(--sd-green);
    color: var(--sd-green);
}

/* ============ RESPONSIVE ============ */

/* Tablet */
@media (max-width: 991px) {
    .sd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-topbar {
        right: 0;
        padding: 0 16px;
    }

    .sd-sidebar {
        transform: translateX(100%);
    }

    .sd-sidebar.open {
        transform: translateX(0);
    }

    .sd-content {
        margin-right: 0;
        padding: 20px;
    }

    .sd-sidebar-toggle {
        display: block;
    }

    .sd-overlay {
        display: block;
    }

    .sd-content-wrapper {
        max-width: 100%;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .sd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sd-course-grid {
        grid-template-columns: 1fr;
    }

    .sd-content {
        padding: 16px;
    }

    .sd-profile-name {
        display: none;
    }

    .sd-welcome-card {
        padding: 24px 20px;
    }

    .sd-welcome-card h2 {
        font-size: 1.2rem;
    }

    .sd-stat-card .stat-number {
        font-size: 1.4rem;
    }

    .sd-topbar-left h5 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .sd-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sd-content {
        padding: 12px;
    }
}
