/* ============================================
   JAKIREN NCLEX NURSING - PROFESSIONAL STYLES
   MODERN SIDEBAR LAYOUT | ENHANCED UI
   ============================================ */

/* CSS Variables - Design System */
:root {
    --primary-dark: #0a3b4e;
    --primary: #1a6b8a;
    --primary-light: #2c9b7a;
    --secondary: #667eea;
    --secondary-dark: #764ba2;
    --success: #2e8b57;
    --success-light: #3cb371;
    --danger: #dc3545;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray-dark: #475569;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light-gray: #f1f5f9;
    --white: #ffffff;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 35px rgba(0,0,0,0.15);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a2f3f 0%, #05212e 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ========== APP WRAPPER (SIDEBAR + MAIN) ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR STYLES ========== */
.sidebar {
    width: 280px;
    background: rgba(10, 47, 63, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
    font-size: 32px;
    background: linear-gradient(135deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text h2 {
    font-size: 20px;
    color: white;
    letter-spacing: -0.3px;
}

.brand-text span {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    font-size: 18px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: linear-gradient(95deg, rgba(44, 155, 122, 0.25), rgba(26, 107, 138, 0.3));
    color: white;
    border-left: 3px solid var(--primary-light);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
}

.user-info-mini {
    flex: 1;
}

.user-info-mini span {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-info-mini small {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    border-radius: var(--radius-md);
    color: #ff8a8a;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.4);
    color: white;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-x: auto;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-size: 28px;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-title p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-top: 4px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-badge {
    position: relative;
    background: rgba(255,255,255,0.15);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.notification-badge i {
    color: white;
    font-size: 18px;
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
}

.user-greeting {
    background: rgba(255,255,255,0.12);
    padding: 8px 18px;
    border-radius: 40px;
    color: white;
    font-size: 14px;
}

.user-greeting strong {
    font-weight: 700;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(125deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    backdrop-filter: blur(2px);
}

.welcome-text h2 {
    font-size: 26px;
    margin-bottom: 8px;
}

.welcome-text p {
    opacity: 0.9;
    margin-bottom: 12px;
}

.motivation-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
}

.streak-badge {
    background: rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: 60px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.streak-number {
    font-size: 28px;
    font-weight: 800;
}

/* Stats Cards Enhanced */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(27, 79, 110, 0.1), rgba(44, 155, 122, 0.1));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-icon-wrapper i {
    font-size: 24px;
    color: var(--primary);
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray);
    font-size: 13px;
    font-weight: 500;
}

.stat-trend {
    font-size: 11px;
    margin-top: 8px;
    color: var(--success);
}

.stat-trend.positive {
    color: var(--success);
}

/* Progress Section */
.progress-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.progress-label {
    font-weight: 700;
    color: var(--dark);
    font-size: 16px;
}

.progress-value {
    font-weight: 700;
    color: var(--primary);
}

.progress-bar-container {
    background: var(--light-gray);
    border-radius: 60px;
    height: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--success), var(--success-light));
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 60px;
}

.progress-details {
    margin-top: 12px;
    font-size: 13px;
    color: var(--gray);
}

/* Featured Section */
.featured-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.featured-section h3 {
    margin-bottom: 18px;
    color: var(--dark);
    font-size: 18px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.featured-item {
    background: var(--light-gray);
    padding: 10px 16px;
    border-radius: 50px;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    color: var(--primary);
    transition: all 0.2s;
    cursor: default;
}

.featured-item i {
    margin-right: 6px;
}

/* Filter Bar */
.filter-bar {
    background: var(--white);
    border-radius: 60px;
    padding: 6px 16px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    background: var(--light-gray);
    font-weight: 500;
    transition: all 0.25s;
    font-size: 13px;
}

.filter-btn i {
    margin-right: 6px;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.month-select {
    padding: 8px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 40px;
    background: var(--white);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
}

/* Lectures Grid */
.lectures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.lecture-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
}

.lecture-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.lecture-card.locked {
    opacity: 0.85;
    background: #f8fafc;
}

/* Badges */
.badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-free { background: var(--warning); color: white; }
.badge-unlocked { background: var(--success); color: white; }
.badge-locked { background: var(--danger); color: white; }

.lecture-number {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 12px;
}

.lecture-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.4;
}

.lecture-duration {
    color: var(--gray);
    font-size: 12px;
    margin-bottom: 16px;
}

.lecture-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--success);
    margin: 16px 0;
}

/* Buttons on lectures */
.watch-btn, .unlock-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 60px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 14px;
}

.watch-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.unlock-btn {
    background: var(--success);
    color: white;
}

.watch-btn:hover, .unlock-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px;
    background: var(--white);
    border-radius: var(--radius-lg);
    color: var(--gray);
}

.empty-state {
    text-align: center;
    padding: 60px;
    background: var(--white);
    border-radius: var(--radius-lg);
    color: var(--gray);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-header i {
    font-size: 28px;
    color: var(--primary);
}

.modal-header.success i {
    color: var(--success);
}

/* Payment Details */
.payment-detail-card {
    text-align: center;
    padding: 16px;
}

.price-tag {
    font-size: 48px;
    font-weight: 800;
    color: var(--success);
    margin: 20px 0;
}

.payment-actions {
    margin-top: 20px;
}

.payment-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 60px;
    font-weight: 600;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.25s;
}

.btn-mpesa {
    background: #6b1e1e;
    color: white;
}

.btn-card {
    background: #1e3a8a;
    color: white;
}

.bundle-offer {
    text-align: center;
    padding: 16px;
}

.bundle-price {
    font-size: 52px;
    font-weight: 800;
    color: var(--success);
    margin: 16px 0;
}

.btn-bundle {
    width: 100%;
    margin-top: 16px;
}

/* Video Modal */
.video-modal-content {
    max-width: 800px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 16px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

.video-notes {
    margin-top: 16px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 16px;
    }
    
    .sidebar-brand {
        padding: 8px 12px;
    }
    
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
    }
    
    .nav-item {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .lectures-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        border-radius: var(--radius-md);
        align-items: stretch;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .month-select {
        width: 100%;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .toast {
        white-space: normal;
        text-align: center;
        max-width: 90%;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .welcome-text h2 {
        font-size: 20px;
    }
    
    .page-title h1 {
        font-size: 22px;
    }
}
