@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e8e8e8;
    color: #333;
    min-height: 100vh;
}

a { color: inherit; }

/* Navbar */
.navbar-main {
    background-color: #2c2c2c;
    padding: 0 30px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #222;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-brand .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #c0392b, #a93226);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.navbar-brand .logo-icon svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.navbar-brand .brand-text {
    color: #fff;
    font-size: 20px;
    letter-spacing: 2px;
}

.navbar-brand .brand-text span {
    font-style: italic;
    font-weight: 300;
}

.navbar-brand .brand-sub {
    color: #aaa;
    font-size: 9px;
    letter-spacing: 4px;
    text-transform: uppercase;
    display: block;
    margin-top: -2px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2px;
}

.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-link {
    color: #bbb;
    text-decoration: none;
    padding: 10px 14px;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}

.navbar-nav .nav-link .nav-icon {
    font-size: 15px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    min-width: 210px;
    padding: 6px 0;
    z-index: 1001;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 18px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background-color: #f0f0f0;
    color: #c0392b;
}

.dropdown-menu .divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.35);
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .login-logo .logo-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #c0392b, #a93226);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.login-card .login-logo .logo-circle svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.login-card .login-logo h2 {
    font-size: 22px;
    color: #333;
    letter-spacing: 2px;
}

.login-card .login-logo h2 span {
    font-style: italic;
    font-weight: 300;
}

.login-card .login-logo p {
    color: #999;
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background-color: #c0392b;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background-color: #a93226;
}

.btn-success {
    background-color: #c0392b;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    padding: 14px 30px;
    border-radius: 25px;
}

.btn-success:hover {
    background-color: #a93226;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #c0392b;
    color: #fff;
}

.btn-info:hover {
    background-color: #a93226;
}

.btn-outline {
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
}

.btn-outline:hover {
    background: #c0392b;
    color: #fff;
}

.btn-outline-light {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.btn-outline-light:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Page Header */
.page-header {
    background-color: #c0392b;
    color: #fff;
    padding: 18px 28px;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 0;
    border-radius: 6px 6px 0 0;
    letter-spacing: 0.5px;
}

/* Content Container */
.content-wrapper {
    max-width: 1100px;
    margin: 25px auto;
    padding: 0 20px;
}

.content-wrapper.wide {
    max-width: 1300px;
}

.content-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    padding: 28px;
}

.course-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #333;
    display: block;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.course-thumbnail {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    padding: 15px;
    position: relative;
}

.course-thumbnail .course-abbr {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
}

.course-thumbnail .course-subtitle {
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    margin-top: 4px;
    font-weight: 700;
}

.course-thumbnail .course-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.course-thumbnail .iw-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-thumbnail .iw-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.course-card-body {
    padding: 14px;
    text-align: center;
}

.course-card-body h3 {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    line-height: 1.4;
}

/* Course Detail */
.course-banner {
    text-align: center;
    padding: 30px;
    background: #fff;
}

.course-banner img,
.course-banner .banner-placeholder {
    max-width: 250px;
    height: 180px;
    border-radius: 8px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-weight: 700;
}

.course-description {
    padding: 0 40px 20px;
    line-height: 1.8;
    font-size: 14px;
    color: #555;
}

.course-description a {
    color: #9b59b6;
    text-decoration: none;
}

.course-description a:hover {
    text-decoration: underline;
}

.completion-banner {
    text-align: center;
    padding: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: none;
    margin-top: 10px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 13px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    color: #888;
    background: #ececec;
    transition: all 0.2s;
}

.tab.active {
    background: #c0392b;
    color: #fff;
}

.tab:hover:not(.active) {
    background: #e0e0e0;
}

/* Progress Bar */
.progress-section {
    padding: 30px 40px;
    text-align: center;
}

.progress-section h2 {
    font-size: 22px;
    font-weight: 400;
    color: #333;
    margin-bottom: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

/* Unit & Lesson List */
.unit-list {
    padding: 0 40px 40px;
}

.unit-header {
    background: #f8f9fa;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.5px;
    border-radius: 4px 4px 0 0;
    margin-top: 25px;
    border: 1px solid #e9ecef;
}

.lesson-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border: 1px solid #e9ecef;
    border-top: none;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: background 0.15s;
}

.lesson-item:hover {
    background: #f8f9fa;
}

.lesson-item .check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-item .check-icon.completed {
    background: #28a745;
}

.lesson-item .check-icon.completed svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.lesson-item .check-icon.incomplete {
    border: 2px solid #ddd;
    background: #fff;
}

/* Lesson Content Page */
.lesson-content {
    padding: 40px;
    line-height: 1.8;
    font-size: 15px;
}

.lesson-content h1 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    border-top: 1px solid #eee;
}

.lesson-nav .btn {
    padding: 10px 20px;
}

/* ========================
   ADMIN PANEL STYLES
   ======================== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.admin-sidebar {
    width: 240px;
    background: #1e1e2d;
    color: #8a8a9e;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 10px;
}

.admin-sidebar .sidebar-header h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.admin-sidebar .sidebar-header p {
    font-size: 11px;
    color: #636378;
    margin-top: 3px;
}

.admin-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #8a8a9e;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.admin-sidebar .sidebar-nav a:hover,
.admin-sidebar .sidebar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.04);
    border-left-color: #c0392b;
}

.admin-sidebar .sidebar-nav a .sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.admin-content {
    flex: 1;
    padding: 25px 30px;
    background: #f0f0f5;
    overflow-y: auto;
}

.admin-content h1 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: #e3f2fd; }
.stat-card .stat-icon.green { background: #e8f5e9; }
.stat-card .stat-icon.orange { background: #fff3e0; }
.stat-card .stat-icon.purple { background: #f3e5f5; }

.stat-card .stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.stat-card .stat-info p {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #fafafa;
}

.data-table .actions {
    display: flex;
    gap: 6px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-student { background: #e3f2fd; color: #1565c0; }
.badge-ambassador { background: #fff3e0; color: #e65100; }
.badge-admin { background: #f3e5f5; color: #7b1fa2; }
.badge-active { background: #e8f5e9; color: #2e7d32; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================
   AMBASSADOR STYLES
   ======================== */
.ambassador-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.amb-card {
    background: #fff;
    border-radius: 6px;
    padding: 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.amb-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c0392b;
}

.team-member {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

.team-member:last-child {
    border-bottom: none;
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b, #a93226);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.member-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.member-info p {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.progress-mini {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-mini .fill {
    height: 100%;
    background: #28a745;
    border-radius: 2px;
}

.announcement-item {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.announcement-item p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.announcement-item .date {
    font-size: 11px;
    color: #aaa;
    margin-top: 5px;
}

/* (Responsive rules moved below loading spinner section) */

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 11px;
    margin-top: 40px;
    letter-spacing: 0.5px;
}

/* ========================
   COURSE PRICING
   ======================== */
.course-price-tag {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
}

.price-free {
    color: #28a745;
    background: #e8f5e9;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 1px;
}

.price-paid {
    color: #1565c0;
    background: #e3f2fd;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 1px;
}

.price-pending {
    color: #e65100;
    background: #fff3e0;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.price-amount {
    color: #fff;
    background: #c0392b;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* ========================
   CHECKOUT PAGE
   ======================== */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.checkout-course-info {
    padding: 30px;
    border-right: 1px solid #eee;
}

.checkout-payment-form {
    padding: 30px;
}

.checkout-price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.checkout-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.checkout-amount {
    font-size: 26px;
    font-weight: 700;
    color: #c0392b;
}

.payment-instructions {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 22px;
    border: 1px solid #e9ecef;
}

.payment-instructions h4 {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.payment-instructions ol {
    padding-left: 18px;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

.payment-methods-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.pay-method-option {
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
}

.pay-method-option strong {
    display: block;
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
}

.pay-method-option span {
    font-size: 12px;
    color: #888;
}

@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    .checkout-course-info {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .payment-methods-display {
        grid-template-columns: 1fr;
    }
}

/* ========================
   LOADING SPINNER
   ======================== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #888;
    gap: 10px;
}

.page-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================
   ENHANCED MOBILE RESPONSIVE
   ======================== */
@media (max-width: 992px) {
    .course-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .ambassador-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .course-grid { grid-template-columns: repeat(2, 1fr); }

    .navbar-main {
        padding: 0 10px;
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
    }

    .navbar-brand {
        font-size: 13px;
    }

    .navbar-nav {
        gap: 0;
    }

    .navbar-nav .nav-link {
        padding: 8px 8px;
        font-size: 10px;
        letter-spacing: 0;
    }

    .content-wrapper {
        padding: 10px;
        margin-top: 10px;
    }

    .content-wrapper.wide {
        padding: 10px;
    }

    .course-description,
    .unit-list,
    .progress-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    .lesson-content {
        padding: 20px 15px;
    }

    .lesson-nav {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .lesson-nav .btn {
        text-align: center;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: unset;
        padding: 10px 14px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .admin-sidebar {
        width: 54px;
    }

    .admin-sidebar .sidebar-header h3,
    .admin-sidebar .sidebar-header p,
    .admin-sidebar .sidebar-nav a span:not(.sidebar-icon) {
        display: none;
    }

    .admin-sidebar .sidebar-nav a {
        justify-content: center;
        padding: 12px;
    }

    .admin-content {
        padding: 15px;
    }

    .admin-content h1 {
        font-size: 18px;
    }

    .ambassador-grid { grid-template-columns: 1fr; }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    /* Mobile-friendly data tables */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content, .modal {
        max-width: 95vw;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .course-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }

    .navbar-nav .nav-link {
        padding: 8px 5px;
        font-size: 9px;
    }

    .login-card, .register-card {
        padding: 25px 20px;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-course-info {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 20px;
    }

    .checkout-payment-form {
        padding: 20px;
    }
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ========================
   DARK MODE
   ======================== */
body.dark-mode {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .navbar-main {
    background-color: #16213e;
    border-bottom-color: #0f3460;
}

body.dark-mode .content-card,
body.dark-mode .amb-card,
body.dark-mode .stat-card {
    background: #16213e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    color: #e0e0e0;
}

body.dark-mode .content-card a { color: #e8a0a0; }

body.dark-mode .page-header {
    color: #e0e0e0;
}

body.dark-mode .course-card {
    background: #16213e;
}

body.dark-mode .course-card-body h3 {
    color: #e0e0e0;
}

body.dark-mode .unit-header {
    background: #0f3460;
    color: #e0e0e0;
    border-color: #1a1a3e;
}

body.dark-mode .lesson-item {
    border-color: #1a1a3e;
    color: #ccc;
}

body.dark-mode .lesson-item:hover {
    background: #0f3460;
}

body.dark-mode .tabs {
    background: #0f3460;
}

body.dark-mode .tab {
    background: #16213e;
    color: #aaa;
}

body.dark-mode .tab:hover:not(.active) {
    background: #1a1a3e;
}

body.dark-mode .data-table th {
    background: #0f3460;
    color: #aaa;
    border-bottom-color: #1a1a3e;
}

body.dark-mode .data-table td {
    color: #ccc;
    border-bottom-color: #1a1a3e;
}

body.dark-mode .data-table tr:hover {
    background: #0f3460;
}

body.dark-mode .admin-content {
    background: #111128;
}

body.dark-mode .modal-content,
body.dark-mode .modal {
    background: #16213e;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-bottom-color: #1a1a3e;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #0f3460;
    border-color: #1a1a3e;
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #bbb;
}

body.dark-mode .dropdown-menu {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .dropdown-menu a {
    color: #ccc;
}

body.dark-mode .dropdown-menu a:hover {
    background: #0f3460;
}

body.dark-mode .progress-bar-container {
    background: #0f3460;
}

body.dark-mode .course-description {
    color: #bbb;
}

body.dark-mode .footer {
    color: #555;
}

body.dark-mode .alert-danger {
    background: #3d1c1c;
    color: #ef9a9a;
    border-color: #5c2828;
}

body.dark-mode .badge-student { background: #0f3460; color: #64b5f6; }
body.dark-mode .badge-ambassador { background: #3e2723; color: #ffb74d; }
body.dark-mode .badge-admin { background: #2e1534; color: #ce93d8; }

/* Dark mode toggle switch */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active {
    background: #c0392b;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}
