/* ============================================================================
   IgniteHub Design System - Shared Styles for All Demos
   
   This file contains all shared CSS for instructor, studio, and student demos.
   Per-demo overrides go in *-overrides.css files.
   ============================================================================ */

/* ============================================================================
   CSS Custom Properties (Design Tokens)
   ============================================================================ */
:root {
  /* Brand Colors */
  --brand-bg: #FFF8F0;
  --brand-primary: #D2691E;
  --brand-primary-light: #FF8C00;
  --brand-primary-dark: #A0522D;
  --brand-dark: #2C2C2C;
  --brand-dark-alt: #1A1A1A;
  --brand-text: #2C2C2C;
  --brand-text-light: #707070;
  --brand-white: #FFFFFF;
  
  /* Semantic Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;
  
  /* Layout Dimensions */
  --header-height-desktop: 80px;
  --header-height-mobile: 56px;
  --nav-width: 280px;
  --drawer-width: 280px;
  
  /* Z-Index Scale */
  --z-base: 1;
  --z-nav: 100;
  --z-dropdown: 900;
  --z-overlay: 999;
  --z-drawer: 1000;
  --z-hamburger: 1002;
  --z-header: 1005;
  --z-modal: 2000;
  --z-toast: 3000;
  
  /* Motion & Animation */
  --motion-duration-fast: 0.2s;
  --motion-duration: 0.3s;
  --motion-duration-slow: 0.4s;
  --motion-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.3);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --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: 2rem;
  
  /* Breakpoints (for JS reference) */
  --bp-mobile: 768px;
  --bp-tablet: 1024px;
  --bp-desktop: 1280px;
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */
.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--brand-bg);
    color: var(--brand-text);
    line-height: 1.5;
}

/* ============================================================================
   Header System
   ============================================================================ */
.studio-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: var(--z-header);
    background: var(--brand-dark) !important;
    background-color: var(--brand-dark) !important;
    box-shadow: var(--shadow-header);
    height: var(--header-height-desktop);
    pointer-events: auto;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    height: 100%;
    max-width: none;
    position: relative;
    pointer-events: auto;
}

.header-content > * {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Persona Badge */
.persona-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--space-sm) var(--space-md);
    background: var(--brand-white);
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-md);
}

.persona-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-white);
    font-weight: 700;
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.persona-text {
    display: flex;
    flex-direction: column;
}

.persona-label {
    font-size: var(--font-size-xs);
    color: var(--brand-text-light);
    font-weight: 500;
}

.persona-name {
    color: var(--brand-text);
    font-weight: 700;
    font-size: 0.9375rem;
}

.powered-by-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--brand-text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: var(--space-sm) var(--space-md);
    background: var(--brand-bg);
    border-radius: var(--radius-md);
}

/* Notification Button */
.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer !important;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--motion-duration-fast);
    z-index: var(--z-dropdown);
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(255, 248, 240, 0.2);
    touch-action: manipulation;
}

.notification-btn:hover {
    background: rgba(255, 248, 240, 0.1);
}

.notification-btn:active {
    background: rgba(255, 248, 240, 0.3);
    transform: scale(0.95);
}

.notification-btn svg {
    display: block;
    pointer-events: none !important;
}

.notification-btn svg path {
    pointer-events: none !important;
}

#notificationCount {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-error);
    color: var(--brand-white);
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px;
    text-align: center;
    line-height: 14px;
    pointer-events: none !important;
}

/* Launch Class CTA Button */
.launch-class-cta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-primary-light) 0%, var(--brand-primary) 100%);
    color: var(--brand-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--font-size-base);
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.3);
    transition: all var(--motion-duration-fast);
    z-index: var(--z-dropdown);
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(210, 105, 30, 0.2);
    touch-action: manipulation;
}

.launch-class-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(210, 105, 30, 0.4);
}

.launch-class-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(210, 105, 30, 0.5);
}

.launch-class-cta svg {
    pointer-events: none !important;
}

.launch-class-cta svg path,
.launch-class-cta svg polyline {
    pointer-events: none !important;
}

.launch-class-cta span {
    pointer-events: none !important;
}

/* ============================================================================
   Mobile Hamburger Menu
   ============================================================================ */
.mobile-hamburger {
    display: none;
    position: relative;
    background: none;
    border: none;
    cursor: pointer !important;
    padding: var(--space-sm);
    z-index: var(--z-hamburger) !important;
    border-radius: var(--radius-md);
    transition: background var(--motion-duration-fast) ease;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(255, 248, 240, 0.2);
    touch-action: manipulation;
}

.mobile-hamburger.active {
    z-index: var(--z-hamburger) !important;
    background: rgba(255, 248, 240, 0.2);
}

.mobile-hamburger:hover {
    background: rgba(255, 248, 240, 0.15);
}

.mobile-hamburger.active:hover {
    background: rgba(255, 248, 240, 0.25);
}

.mobile-hamburger:focus {
    outline: 2px solid rgba(255, 248, 240, 0.5);
    outline-offset: 2px;
}

.mobile-hamburger:active {
    transform: scale(0.92);
    background: rgba(255, 248, 240, 0.25);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    pointer-events: none !important;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--brand-bg);
    border-radius: 2px;
    transition: all var(--motion-duration) var(--motion-easing);
    pointer-events: none !important;
}

/* Transform to X when active */
.mobile-hamburger.active .hamburger-icon span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background: var(--brand-bg) !important;
}

.mobile-hamburger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-hamburger.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
    background: var(--brand-bg) !important;
}

/* ============================================================================
   Mobile Navigation Drawer
   ============================================================================ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity var(--motion-duration) ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: -100%;
    width: var(--drawer-width);
    max-width: 85vw;
    height: calc(100vh - var(--header-height-mobile));
    background: var(--brand-white);
    z-index: var(--z-drawer);
    overflow-y: auto;
    transition: left var(--motion-duration) var(--motion-easing);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer.active {
    left: 0;
}

.mobile-nav-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-dark-alt) 100%);
    color: var(--brand-white);
    border-bottom: 1px solid #E5E5E5;
}

.mobile-nav-header h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: #FFFFFF !important;
}

.mobile-nav-header p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: #E97451 !important;
    opacity: 1;
    font-weight: 500;
}

.mobile-nav-links {
    padding: var(--space-md) 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 1.5rem;
    color: var(--brand-text);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: all var(--motion-duration-fast);
    cursor: pointer;
}

.mobile-nav-link:hover {
    background: rgba(210, 105, 30, 0.05);
    color: var(--brand-primary);
}

.mobile-nav-link.active {
    background: linear-gradient(90deg, rgba(210, 105, 30, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    color: var(--brand-primary);
    border-left: 4px solid var(--brand-primary);
    font-weight: 700;
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================================================
   Desktop Left Navigation
   ============================================================================ */
.studio-layout {
    display: flex;
    min-height: 100vh;
    margin-top: var(--header-height-desktop);
}

.left-nav {
    position: fixed;
    left: 0;
    top: var(--header-height-desktop);
    width: var(--nav-width);
    height: calc(100vh - var(--header-height-desktop));
    background: var(--brand-white);
    border-right: 1px solid #E5E5E5;
    overflow-y: auto;
    z-index: var(--z-nav);
}

.nav-section {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid #E5E5E5;
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 1.5rem;
    color: var(--brand-text);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: all var(--motion-duration-fast);
    cursor: pointer;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: rgba(210, 105, 30, 0.05);
    color: var(--brand-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(210, 105, 30, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 700;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================================================
   Main Content Area
   ============================================================================ */
.main-content {
    flex: 1;
    margin-left: var(--nav-width);
    padding: var(--space-xl);
    background: var(--brand-bg);
    min-height: calc(100vh - var(--header-height-desktop));
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ============================================================================
   List/Detail Flyout Pattern (Shared)
   ============================================================================ */
.students-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    overflow: hidden;
}

.students-list {
    width: 40%;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    min-height: 0;
}

.students-filter {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    padding-right: var(--space-sm);
}

.students-filter input {
    width: 100%;
    padding: 0.75rem var(--space-md);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all var(--motion-duration-fast) ease;
    box-sizing: border-box;
}

.students-filter input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
}

#studentsList, #classesList, #messagesList, #studiosList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: var(--space-sm);
    padding-top: 5px;
    flex: 1;
    min-height: 0;
}

.student-list-item {
    background: var(--brand-white);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--motion-duration-fast) ease;
    display: flex;
    gap: var(--space-md);
    align-items: center;
    position: relative;
}

.student-list-item:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 2px 12px rgba(210, 105, 30, 0.1);
}

.student-list-item.active {
    border: 3px solid #B85A1A;
    background: linear-gradient(135deg, var(--brand-bg) 0%, #FFE8D6 100%);
    box-shadow: 0 4px 16px rgba(210, 105, 30, 0.35);
    transform: translateY(-2px);
}

.student-list-item.unread {
    position: relative;
}

.student-list-item .unread-dot {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 8px;
    height: 8px;
    background: var(--color-info);
    border-radius: var(--radius-full);
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: var(--brand-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.student-info {
    flex: 1;
    min-width: 0;
}

.student-info h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--brand-text);
    margin: 0 0 var(--space-xs) 0;
}

.mobile-back-button {
    display: none !important;
}

.student-detail-flyout {
    width: 60%;
    background: var(--brand-white);
    border-radius: var(--radius-lg);
    border: 2px solid #E0E0E0;
    padding: var(--space-xl);
    overflow-y: auto;
    animation: slideUp var(--motion-duration-slow) ease-out;
    min-height: 0;
    max-height: 100%;
}

.student-detail-flyout.visible {
    animation: slideUp var(--motion-duration-slow) ease-out;
}

.student-detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #E0E0E0;
    margin-bottom: 1.5rem;
}

.student-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: var(--brand-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.student-detail-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-text);
    margin: 0 0 var(--space-sm) 0;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.at-risk {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.inactive {
    background: #F3F4F6;
    color: #4B5563;
}

/* ============================================================================
   Animations
   ============================================================================ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================================================
   Responsive Breakpoints
   ============================================================================ */
@media (max-width: 1023px) {
    /* Hide desktop left navigation */
    .left-nav {
        display: none !important;
    }
    
    /* Show mobile hamburger */
    .mobile-hamburger {
        display: block !important;
    }
    
    /* Overlay and drawer should only be visible when active */
    .mobile-nav-overlay.active {
        display: block !important;
    }
    
    .mobile-nav-drawer.active {
        display: block !important;
    }
    
    .studio-layout {
        flex-direction: column;
        max-width: 100vw;
        overflow-x: hidden;
        margin-top: var(--header-height-mobile);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }
}

/* Tablet/Mobile Header Adjustments */
@media (max-width: 1023px) {
    .studio-header {
        height: var(--header-height-mobile);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: var(--z-header);
    }
    
    .header-content {
        padding: 0 var(--space-md);
    }
    
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Hamburger button positioning */
    .mobile-hamburger {
        order: 0;
    }
    
    /* Container for persona badge area - move to right with notification */
    .header-left-section {
        order: 2;
        flex: 0 0 auto;
        gap: 0.375rem;
        margin-left: auto;
        display: flex;
        align-items: center;
    }
    
    /* Hide "Powered by" badge on tablet/mobile */
    .powered-by-badge {
        display: none !important;
    }
    
    /* Make persona badge compact - hide text, show only avatar */
    .persona-badge {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        gap: 0 !important;
    }
    
    .persona-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9375rem !important;
    }
    
    /* Hide "Teaching as" text completely on tablet */
    .persona-text {
        display: none !important;
    }
    
    .header-right-section {
        order: 1;
        flex: 0 0 auto;
        margin: 0 auto;
    }
    
    .launch-class-cta {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }
    
    .launch-class-cta span {
        display: none;
    }
}

/* Mobile-only adjustments */
@media (max-width: 767px) {
    .header-content {
        padding: 0 var(--space-sm);
    }
    
    .launch-class-cta {
        padding: var(--space-sm);
    }
}
