/* Teachers Academy - Modern Responsive CSS */
:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --secondary: #7c3aed;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; }

/* ========== HEADER ========== */
.header {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 16px;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.logo img {
    height: auto;
    width: 80px;
    border-radius: 50%;
}

.logo-text { display: none; }
@media (min-width: 640px) { .logo-text { display: block; } }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-dark {
    background: #0f172a;
    color: #fff;
}
.btn-dark:hover { background: #1e293b; }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* Menu Toggle */
.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 8px;
    display: flex;
    align-items: center;
}

/* Side Menu (Toggle) */
.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 2000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.side-menu.open { right: 0; }

.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.side-menu-header img {
    height: 70px;
    margin-bottom: 8px;
}

.side-menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.side-menu-nav {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.side-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.side-menu-item:hover, .side-menu-item.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.side-menu-item i { font-size: 1.4rem; }

.side-menu-links {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.side-menu-links h4 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 12px;
}

.side-menu-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--dark);
    font-size: 0.95rem;
}
.side-menu-links a:hover { color: var(--primary); }

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: none;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 8px;
    display: none;
    z-index: 100;
}

.user-menu.show { display: block; }

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--dark);
}
.user-menu a:hover { background: #f1f5f9; color: var(--primary); }

/* ========== MAIN CONTENT ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.section { padding: 24px 0; }

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--dark);
}

/* Category Cards (Select Your Exam) */
.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar { height: 4px; }
.category-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.category-card {
    flex: 0 0 130px;
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover, .category-card.active {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.category-card img, .category-card .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
}

.category-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.category-card span {
    font-size: 0.7rem;
    color: var(--gray);
}

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

.course-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}

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

.course-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    overflow: hidden;
}

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

.course-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fbbf24;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.course-body {
    padding: 16px;
}

.course-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 12px;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.course-price .sale {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
}

.course-price .original {
    font-size: 0.9rem;
    color: var(--gray);
    text-decoration: line-through;
}

.course-price .discount {
    background: #dcfce7;
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.course-actions {
    display: flex;
    gap: 8px;
}

.course-actions .btn {
    flex: 1;
    padding: 10px;
}

/* Tabs / Explore Dropdown */
.explore-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.explore-tab {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.explore-tab:hover, .explore-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== COURSE DETAIL ========== */
.course-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0;
}

@media (min-width: 900px) {
    .course-detail {
        grid-template-columns: 380px 1fr;
    }
}

.course-detail-left .course-thumb {
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.price-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.price-row:last-child { border: none; }

.price-row .label { color: var(--gray); }
.price-row .value { font-weight: 700; }
.price-row .value.sale { color: var(--danger); font-size: 1.3rem; }

.coupon-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.coupon-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.course-features {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.course-features h3 { margin-bottom: 12px; }
.course-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.95rem;
}
.course-features li i { color: var(--success); margin-top: 3px; }

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card p {
    text-align: center;
    color: var(--gray);
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ========== USER DASHBOARD ========== */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0;
}

@media (min-width: 900px) {
    .dashboard {
        grid-template-columns: 260px 1fr;
    }
}

.dash-sidebar {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.dash-sidebar .user-info {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.dash-sidebar .user-info .avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 10px;
}

.dash-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-weight: 500;
    transition: var(--transition);
}
.dash-nav a:hover, .dash-nav a.active {
    background: #eff6ff;
    color: var(--primary);
}

.dash-content {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-card.green { background: linear-gradient(135deg, #059669, #10b981); }
.stat-card.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.stat-card.orange { background: linear-gradient(135deg, #d97706, #f59e0b); }

.stat-card h3 { font-size: 1.8rem; margin-bottom: 4px; }
.stat-card p { font-size: 0.85rem; opacity: 0.9; }

/* My Courses */
.my-course-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    align-items: center;
    transition: var(--transition);
}
.my-course-card:hover { border-color: var(--primary); }

.my-course-card img {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #e2e8f0;
}

.my-course-info { flex: 1; }
.my-course-info h4 { font-size: 1rem; margin-bottom: 4px; }
.my-course-info .expiry {
    font-size: 0.8rem;
    color: var(--gray);
}
.my-course-info .expiry.expired { color: var(--danger); }
.my-course-info .expiry.active { color: var(--success); }

/* ========== ADMIN ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #0f172a;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
}

.admin-sidebar .logo {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    color: #fff;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #94a3b8;
    transition: var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
    background: #1e293b;
    color: #fff;
    border-left: 3px solid var(--primary);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f1f5f9;
    min-height: 100vh;
}

.admin-header {
    background: #fff;
    padding: 16px 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-content { padding: 24px; }

.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
}

tr:hover td { background: #f8fafc; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ========== FOOTER ========== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 40px 0 20px;
    margin-top: 40px;
}

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

.footer h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer a {
    display: block;
    padding: 6px 0;
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

/* ========== UTILITIES ========== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.text-center { text-align: center; }
.text-muted { color: var(--gray); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 12px; }
.hidden { display: none !important; }

/* Mobile App-like feel */
@media (max-width: 768px) {
    .header-inner { height: 56px; }
    .course-grid { grid-template-columns: 1fr; }
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .my-course-card { flex-direction: column; text-align: center; }
    .my-course-card img { width: 100%; height: 140px; }
}

/* Live indicator */
.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* ========== CART ========== */
.cart-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--primary);
    font-size: 1.1rem;
    transition: 0.2s;
}
.cart-btn:hover { background: #e0e7ff; }
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.cart-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.cart-item {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    align-items: center;
    flex-wrap: wrap;
}
.cart-thumb {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.cart-info { flex: 1; min-width: 160px; }
.cart-info h3 { font-size: 0.95rem; margin-bottom: 4px; line-height: 1.3; }
.cart-meta { font-size: 0.8rem; color: var(--gray); margin-bottom: 6px; }
.cart-price { font-weight: 700; color: var(--primary); }
.cart-price .original { font-size: 0.8rem; color: #94a3b8; text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.cart-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cart-summary {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    bottom: 16px;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.cart-total strong { font-size: 1.4rem; color: var(--primary); }
.cart-note { font-size: 0.85rem; color: var(--gray); }

/* ========== RESPONSIVE IMPROVEMENTS ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}
.section { padding-top: 20px; padding-bottom: 32px; }

/* Course cards better mobile */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.course-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.course-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
}
.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.course-body h3 {
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}
.course-actions .btn { flex: 1; text-align: center; justify-content: center; }

/* Touch friendly */
.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-sm { min-height: 36px; }

/* Mobile first improvements */
@media (max-width: 640px) {
    .header-inner { height: 56px; }
    .container { padding-left: 12px; padding-right: 12px; }
    .section { padding-top: 14px; padding-bottom: 24px; }
    .course-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .course-body { padding: 10px; }
    .course-body h3 { font-size: 0.82rem; }
    .course-meta { font-size: 0.7rem; }
    .course-price .sale { font-size: 0.9rem; }
    .course-actions { flex-direction: column; gap: 6px; }
    .course-actions .btn { width: 100%; font-size: 0.75rem; padding: 8px; }
    .hero-banner { padding: 24px 16px !important; }
    .hero-banner h1 { font-size: 1.35rem !important; }
    .banner-slider { grid-template-columns: 1fr !important; }
    .cart-item { flex-direction: column; align-items: flex-start; }
    .cart-thumb { width: 100%; height: 140px; }
    .cart-actions { width: 100%; }
    .cart-actions .btn { flex: 1; }
    .promo-card { min-height: 110px; }
    .why-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .why-card { padding: 16px 12px; }
    .cta-band { padding: 24px 16px; }
    .cta-band h2 { font-size: 1.2rem; }
}

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

@media (min-width: 641px) and (max-width: 900px) {
    .course-grid { grid-template-columns: repeat(2, 1fr); }
    .container { padding-left: 20px; padding-right: 20px; }
}

@media (min-width: 901px) {
    .container { padding-left: 24px; padding-right: 24px; }
    .section { padding-top: 28px; padding-bottom: 40px; }
}

/* App-like safe areas */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* Toast already uses alert */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    font-weight: 500;
}
.alert-success { border-left: 4px solid var(--success); color: #065f46; }
.alert-danger { border-left: 4px solid var(--danger); color: #991b1b; }
