/* Modern Index Page Styles - Matching Design System - Updated 2025-08-26 */
/* 
 * This file handles ONLY the index page specific styling:
 * - Navigation bar styling
 * - Button styling (logout, contact us, instructor controls)
 * - Chat form styling
 * - Sidebar toggle styling
 * 
 * Video-related styling is handled by video.css
 * Base styles are handled by main.css
 */

/* CSS Variables for Modern Design System */
:root {
    /* Modern Color Palette */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    /* Vibrant Accent Colors */
    --accent-50: #f0fdf4;
    --accent-100: #dcfce7;
    --accent-200: #bbf7d0;
    --accent-300: #86efac;
    --accent-400: #4ade80;
    --accent-500: #22c55e;
    --accent-600: #16a34a;
    --accent-700: #15803d;
    --accent-800: #166534;
    --accent-900: #14532d;
    
    /* Purple Accent */
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-300: #d8b4fe;
    --purple-400: #c084fc;
    --purple-500: #a855f7;
    --purple-600: #9333ea;
    --purple-700: #7c3aed;
    --purple-800: #6b21a8;
    --purple-900: #581c87;
    
    /* Orange Accent */
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --orange-900: #7c2d12;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    --space-40: 10rem;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
    --font-size-7xl: 4.5rem;
    --font-size-8xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px; /* fixed size */
    min-height: 48px;
    max-height: 48px;
}

.nav-logo .logo-text {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--purple-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}



.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 32px !important;
    min-width: 120px;
    box-sizing: border-box;
    outline: none;
}

/* Override button heights with higher specificity */
.nav-actions .btn {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

/* Ensure button and anchor elements look identical */
button.btn, a.btn {
    border: 2px solid transparent;
    outline: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.92));
    color: var(--white);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent !important;
    outline: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), rgba(67, 56, 202, 0.92));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: var(--white);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    font-size: var(--font-size-base);
}

.btn-text {
    font-weight: 600;
}

/* Main Container Adjustments */
.container {
    padding-top: 48px; /* account for fixed navbar */
}

.container.with-visibility-bar {
    padding-top: 76px; /* navbar 48 + visibility bar 28 */
}

/* Visibility Switches Bar (sticky under navbar) */
.visibility-bar {
    position: fixed;
    top: 48px; /* fixed directly under navbar */
    left: 0;
    right: 0;
    z-index: 900;
    height: 28px; /* fixed */
    min-height: 28px;
    max-height: 28px;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
}

.visibility-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
}

.visibility-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.lecture-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
    padding-left: 8px;
}

.visibility-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    color: var(--gray-700);
}

/* Pill switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px; /* fixed */
    height: 22px; /* fixed */
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    transition: var(--transition-fast);
    border-radius: 9999px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; /* fixed */
    width: 18px;  /* fixed */
    left: 2px;
    top: 2px;
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.92));
    border-radius: 50%;
    transition: var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.35));
}

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

.switch input:focus-visible + .slider {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.switch.disabled .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Subtle fade/lock for disabled switches */
.switch.disabled .slider:before {
    background: linear-gradient(135deg, var(--gray-400), var(--gray-300));
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

/* Video Toggle Button - Styling handled by video.css */

/* Sidebar Toggle Button - Modern Gradient Styling */
.sidebar-toggle {
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.92));
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, var(--primary-700), rgba(67, 56, 202, 0.92));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Sidebar Content Modernization */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}

.sidebar-content {
    padding: var(--space-4);
}

.lectures-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lecture-item {
    margin-bottom: var(--space-3);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
}

.lecture-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
}

.lecture-row:hover {
    background: var(--gray-50);
    border-color: var(--primary-200);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

/* Livestream row styling (match primary button color) */
#recorded-lectures-sidebar .lecture-item.livestream-item .lecture-row {
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.92));
    border-color: var(--primary-600);
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    outline: none;
}

#recorded-lectures-sidebar .lecture-item.livestream-item .lecture-row:hover {
    background: linear-gradient(135deg, var(--primary-700), rgba(67, 56, 202, 0.92));
    border-color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#recorded-lectures-sidebar .lecture-item.livestream-item.active .lecture-row {
    background: linear-gradient(135deg, var(--primary-600), rgba(79, 70, 229, 0.92));
    border-color: var(--primary-600);
}

#recorded-lectures-sidebar .lecture-item.livestream-item .lecture-title,
#recorded-lectures-sidebar .lecture-item.livestream-item .chevron {
    color: var(--white);
}

.chevron {
    color: var(--primary-500);
    font-weight: bold;
    transition: var(--transition-normal);
}

.lecture-title {
    flex: 1;
    font-weight: 500;
    color: var(--gray-700);
}

.chat-sublist {
    list-style: none;
    padding-left: var(--space-6);
    margin: var(--space-2) 0;
}

/* Instructor Control Buttons - Modern Style */
.edit-btn-modern, .save-btn-modern {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-sm);
}

.edit-btn-modern:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.save-btn-modern:hover {
    background: var(--accent-50);
    border-color: var(--accent-200);
    color: var(--accent-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Chat Form - Modern Style */
.chat-form-modern {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) 0; /* remove card padding, keep slight vertical spacing */
    background: transparent; /* remove white card */
    border-radius: 0; /* no rounded corners */
    box-shadow: none; /* no shadow */
    border: none; /* no border */
    width: 100%;
    position: sticky; /* default in vertical mode */
    bottom: 0;
    z-index: 1;
}

.chat-form-modern input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: var(--transition-normal);
    background: var(--white);
}

.chat-form-modern input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.chat-form-modern input[type="text"]::placeholder {
    color: var(--gray-400);
}

/* Send button with up arrow icon - Fixed size always */
.chat-form-modern button {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px !important;
    max-width: 44px !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chat-form-modern .btn-icon {
    font-size: var(--font-size-lg);
    font-weight: bold;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 var(--space-4);
    }
    

}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 var(--space-3);
        height: 45px;
    }
    
    .nav-logo .logo-text {
        font-size: var(--font-size-lg);
    }
    

    
    .nav-actions {
        gap: var(--space-2);
    }
    
    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-xs);
        min-width: 100px;
    }
    
    /* Override navbar button heights */
    .nav-actions .btn {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
    }
    
    .container {
        padding-top: 45px; /* match navbar height */
    }
    
    .edit-btn-modern, .save-btn-modern {
        width: 28px;
        height: 28px;
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 640px) {
    .nav-container {
        padding: 0 var(--space-2);
        height: 40px;
        justify-content: space-between;
    }
    
    .nav-logo .logo-text {
        font-size: var(--font-size-base);
    }
    
    .nav-actions {
        gap: var(--space-1);
        width: auto;
        justify-content: flex-end;
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
        min-width: 100px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Override navbar button heights */
    .nav-actions .btn {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
    }
    
    .container {
        padding-top: 40px; /* match navbar height */
    }
    
    .chat-form-modern {
        flex-direction: row;
        gap: var(--space-2);
    }
    
    .chat-form-modern input[type="text"] {
        flex: 1;
        min-width: 0;
    }
    
    /* Button size remains fixed at 44x44px */
}

/* In horizontal mode, use same sticky method as vertical mode */
@media (min-aspect-ratio: 1001/1000) {
    /* Chat form uses same sticky positioning, just contained within chat section */
    #chat-section .chat-form-modern {
        position: sticky;
        bottom: 0;
        z-index: 1;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-1);
        height: 35px;
        justify-content: center;
    }
    
    .nav-logo {
        display: none;
    }
    

    
    .nav-actions {
        gap: var(--space-1);
        width: 100%;
        justify-content: space-between;
    }
    
    .btn {
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-size-xs);
        flex: 1;
        text-align: center;
        min-width: 0;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Override navbar button heights */
    .nav-actions .btn {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
    }
    
    .container {
        padding-top: 35px; /* match navbar height */
    }
    
    .edit-btn-modern, .save-btn-modern {
        width: 24px;
        height: 24px;
        font-size: var(--font-size-xs);
    }
}
