/* style.css - Design System & UI Components */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #16A34A;
    --primary-hover: #15803D;
    --primary-light: #DCFCE7;
    --primary-light-text: #166534;
    --bg-base: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E5E7EB;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ----------------------------------------------------
   UTILITIES
   ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
}

.btn-success-light {
    background-color: var(--primary-light);
    color: var(--primary-light-text);
}

.btn-success-light:hover {
    opacity: 0.9;
}

.card {
    background-color: var(--bg-base);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* ----------------------------------------------------
   AUTHENTICATION SCREENS (login.php, register.php)
   ---------------------------------------------------- */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-secondary);
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.auth-logo .icon-box {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 0.75rem;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.auth-logo h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background-color: var(--bg-secondary);
}

.form-input:focus {
    border-color: var(--primary);
    background-color: var(--bg-base);
}

.form-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.form-links a {
    color: var(--primary);
    font-weight: 500;
}

.form-links a:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ----------------------------------------------------
   MAIN LAYOUT (Dashboard, Course, Lesson)
   ---------------------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-base);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 0.5rem;
    margin-bottom: 2rem;
}

.sidebar-logo i {
    color: var(--primary);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.menu-item a:hover {
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

.menu-item.active a {
    background-color: var(--primary-light);
    color: var(--primary-light-text);
}

.sidebar-promo {
    margin-top: auto;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.sidebar-promo h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-promo p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.sidebar-promo .btn {
    width: 100%;
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: #ffffff;
    color: var(--primary);
}

/* Page Layout */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    height: 70px;
    background-color: var(--bg-base);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    width: 16px;
    height: 16px;
}

.breadcrumb span {
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 0.5rem 0.75rem 0.5rem 2.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.875rem;
    width: 220px;
    background: var(--bg-secondary);
}

.search-input:focus {
    border-color: var(--primary);
    background: #ffffff;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
}

.notification-bell:hover {
    color: var(--text-main);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #EF4444;
    border-radius: 50%;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.user-info {
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    display: block;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* User Dropdown */
.profile-dropdown {
    position: absolute;
    right: 0;
    top: 50px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 180px;
    box-shadow: var(--shadow-md);
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
    z-index: 100;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.profile-dropdown a:hover {
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

.user-profile-menu:hover .profile-dropdown {
    display: flex;
}

/* Content Area Layout */
.content-body {
    flex: 1;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.layout-with-sidebar {
    grid-template-columns: 1fr 340px;
}

/* ----------------------------------------------------
   STUDENT DASHBOARD (dashboard.php)
   ---------------------------------------------------- */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, #F0FDF4 100%);
    border: 1px solid rgba(22, 163, 74, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.welcome-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.courses-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.course-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background-color: var(--primary-light);
}

.course-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.course-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.course-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-progress-wrapper {
    margin-top: auto;
    margin-bottom: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
}

.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.status-badge.released {
    background-color: var(--primary-light);
    color: var(--primary-light-text);
}

.status-badge.pending {
    background-color: #FEF3C7;
    color: #92400E;
}

/* ----------------------------------------------------
   COURSE INTEGRAL PAGE (course.php)
   ---------------------------------------------------- */
.course-hero-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 2rem;
}

.course-hero-img {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: calc(var(--radius) - 4px);
    object-fit: cover;
}

.course-hero-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.course-hero-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.course-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 1rem 0;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.course-meta i {
    width: 16px;
    height: 16px;
}

/* Resume learning card */
.continue-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.continue-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.continue-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.continue-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Module Grid */
.module-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.module-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.module-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.module-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.module-card.completed .module-icon-box {
    background-color: var(--primary-light);
    color: var(--primary);
}

.module-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.module-lessons-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.module-status {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Progress Sidebar Card */
.progress-sidebar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-circle-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 1rem;
}

.progress-circle-svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 10;
}

.progress-circle-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.progress-stats-list {
    width: 100%;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.progress-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.progress-stat-item span:first-child {
    color: var(--text-muted);
}

.progress-stat-item span:last-child {
    font-weight: 600;
}

.progress-msg {
    margin-top: 1rem;
    background-color: var(--primary-light);
    color: var(--primary-light-text);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Lesson navigation sidebar on course details */
.syllabus-card {
    padding: 0;
    overflow: hidden;
}

.syllabus-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.syllabus-body {
    max-height: 500px;
    overflow-y: auto;
}

.syllabus-module-header {
    background-color: var(--bg-secondary);
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.syllabus-module-header:first-child {
    border-top: none;
}

.syllabus-lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    transition: background 0.2s;
    cursor: pointer;
}

.syllabus-lesson-item:hover {
    background-color: var(--bg-secondary);
}

.syllabus-lesson-item.active {
    background-color: var(--primary-light);
    color: var(--primary-light-text);
    font-weight: 500;
}

.syllabus-lesson-item.locked {
    color: var(--text-muted);
    cursor: not-allowed;
}

.lesson-left-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-left-meta i {
    flex-shrink: 0;
}

.lesson-right-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ----------------------------------------------------
   LESSON PLAY AREA (lesson.php)
   ---------------------------------------------------- */
.video-player-container {
    width: 100%;
    background-color: #000000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
    box-shadow: var(--shadow);
}

.video-player-container iframe,
.video-player-container video {
    width: 100%;
    height: 100%;
    border: none;
}

.lesson-info-box {
    margin-top: 1.5rem;
}

.lesson-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.lesson-title-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.lesson-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tabs */
.tabs-container {
    margin-top: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content-panel {
    display: none;
    padding: 1.5rem 0;
}

.tab-content-panel.active {
    display: block;
}

.material-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.material-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-base);
    transition: border-color 0.2s;
}

.material-item:hover {
    border-color: var(--primary);
}

.material-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.material-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-item:hover .material-icon {
    background-color: var(--primary-light);
    color: var(--primary);
}

.material-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.material-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ----------------------------------------------------
   SUCCESS AND PENDING SCREENS
   ---------------------------------------------------- */
.status-screen-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.status-screen-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: 3rem 2rem;
}

.status-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.status-icon-circle.success {
    background-color: var(--primary-light);
    color: var(--primary);
}

.status-icon-circle.pending {
    background-color: #FEF3C7;
    color: #D97706;
}

.status-screen-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.status-screen-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.status-info-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.status-info-box i {
    color: var(--primary);
    flex-shrink: 0;
}

.status-info-box span {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 500;
}

.status-info-box strong {
    display: block;
}

.status-btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ----------------------------------------------------
   PROFILE PAGE (profile.php)
   ---------------------------------------------------- */
.profile-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

.profile-avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border);
    margin-bottom: 1rem;
}

/* ----------------------------------------------------
   CERTIFICATE VIEW
   ---------------------------------------------------- */
.certificate-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--bg-secondary);
}

.certificate-card-print {
    width: 842px; /* A4 Landscape Ratio (approx 1.41) */
    height: 595px;
    background: #ffffff;
    border: 12px double var(--primary);
    border-radius: 4px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.cert-header {
    text-align: center;
}

.cert-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cert-header h1 {
    font-size: 2.5rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

.cert-body {
    text-align: center;
    margin: 2rem 0;
}

.cert-body p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.cert-body .student-name {
    font-size: 1.8rem;
    color: var(--text-main);
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding: 0 1.5rem;
    margin: 1rem 0;
}

.cert-body .course-name {
    font-weight: 700;
    color: var(--primary-light-text);
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.cert-sig {
    text-align: center;
}

.cert-sig-line {
    width: 180px;
    border-top: 1px solid var(--text-main);
    margin-bottom: 0.25rem;
}

.cert-sig-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cert-validation {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cert-qr {
    width: 64px;
    height: 64px;
    background: #e5e7eb; /* Placeholder */
}

/* ----------------------------------------------------
   ADMIN PANEL LAYOUT & VIEWS
   ---------------------------------------------------- */
.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.admin-grid-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-metric-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.admin-metric-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.admin-metric-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-metric-sub {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.admin-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-muted);
}

.admin-table tr:hover td {
    background-color: var(--bg-secondary);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background-color: var(--bg-secondary);
}

.close-modal-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-muted);
}

.close-modal-btn:hover {
    color: var(--text-main);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ----------------------------------------------------
   MOBILE NAVIGATION
   ---------------------------------------------------- */
.mobile-nav-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-header-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

/* Drawer overlay for Mobile Sidebar */
.drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    z-index: 99;
}

/* ----------------------------------------------------
   ANIMATIONS & RESPONSIVENESS
   ---------------------------------------------------- */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Media Queries */
@media (max-width: 1024px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .drawer-overlay.active {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        padding-bottom: 60px; /* Space for bottom nav */
    }

    .header {
        padding: 0 1.25rem;
    }

    .mobile-header-menu-btn {
        display: block;
    }

    .search-box {
        display: none; /* Hide search box on mobile to save space */
    }

    .content-body {
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .course-hero-card {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .continue-card {
        grid-template-columns: 1fr;
    }

    .continue-thumb {
        width: 100%;
    }

    .mobile-nav-bottom {
        display: flex;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Printable Certificate styles */
@media print {
    body * {
        visibility: hidden;
    }
    .certificate-card-print, .certificate-card-print * {
        visibility: visible;
    }
    .certificate-card-print {
        position: absolute;
        left: 0;
        top: 0;
        box-shadow: none;
        border-color: #16A34A !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .no-print {
        display: none !important;
    }
}
