/* Midnight Professional Theme */
:root {
    --bg-primary: #0d0f12;
    --bg-secondary: #151820;
    --bg-card: #1a1f2a;
    --bg-card-hover: #222938;
    --bg-input: #1e2433;
    
    --border-primary: #2a3142;
    --border-accent: #3d4a61;
    
    --text-primary: #e8eaed;
    --text-secondary: #9ca3b0;
    --text-muted: #6b7280;
    
    --accent-primary: #0a5991;
    --accent-primary-hover: #084a7a;
    --accent-primary-light: rgba(10, 89, 145, 0.15);
    
    --accent-secondary: #4a9016;
    --accent-secondary-hover: #3d7a12;
    
    --accent-gold: #f59e0b;
    --accent-gold-hover: #d97706;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --live-red: #ef4444;
    --live-red-glow: rgba(239, 68, 68, 0.4);
}

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

html {
    background: #0d0f12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: radial-gradient(ellipse at top, #1a1f2a 0%, #0d0f12 70%);
    color: #e8eaed;
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(10, 89, 145, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(74, 144, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.header {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2a 50%, #0f1419 100%);
    border-bottom: 1px solid #2a3142;
    color: #e8eaed;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
}

.site-title img {
    height: 180px;
    width: auto;
    display: block;
}

.header-subtitle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
}

.hamburger-menu {
    display: none !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.header-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    border: 1px solid var(--border-primary);
    background: var(--bg-card);
}

.nav-btn:hover {
    background-color: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.user-info {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-info strong {
    color: var(--accent-primary);
}

.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 250px;
    background: #151820;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #2a3142;
    height: fit-content;
    position: sticky;
    top: 100px;
    z-index: 1;
}

.sidebar-btn {
    display: block;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}

.sidebar-btn:hover {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #073d66 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(10, 89, 145, 0.3);
}

.sidebar-btn.school-filter {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-secondary-hover) 100%);
}

.sidebar-btn.school-filter:hover {
    background: linear-gradient(135deg, var(--accent-secondary-hover) 0%, #33630f 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 22, 0.3);
}

.sidebar-btn.selected {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%) !important;
    border: 2px solid var(--accent-primary) !important;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4), 0 0 15px rgba(10, 89, 145, 0.2) !important;
    transform: translateY(1px) !important;
}

.sidebar-btn.selected:hover {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #073d66 100%) !important;
    transform: translateY(1px) translateX(0px) !important;
}

.checkmark {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    margin: 1rem 0;
}

.content {
    flex: 1;
    background: #151820;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #2a3142;
    min-height: 500px;
    position: relative;
    z-index: 1;
}

/* Make content area transparent on auth pages to show body background */
body.auth-page .content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body.auth-page .main-container {
    background: transparent !important;
    padding: 0 !important;
}

body.auth-page .sidebar {
    display: none !important;
}

body.auth-page .content .auth-container {
    margin: 0;
    padding: 2rem;
}

/* Fallback using :has() selector for modern browsers */
.content:has(.auth-container),
.main-container:has(.auth-container) .content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.main-container:has(.auth-container) {
    background: transparent !important;
    padding: 0 !important;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
    padding: 2rem;
}

/* Make content area transparent on auth pages to show body background */
.content:has(.auth-container) {
    background: transparent !important;
    border: none !important;
}

.main-container:has(.auth-container) {
    background: transparent !important;
}

.auth-card {
    background: #1a1f2a;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    border: 1px solid #2a3142;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    width: auto;
    display: block;
    margin: 0 auto;
}

.auth-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.auth-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.auth-card .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e8eaed;
    font-size: 0.9rem;
}

.form-group input,
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #2a3142;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #1e2433;
    color: #e8eaed;
}

.form-group input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(10, 89, 145, 0.1);
}

.form-group input::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

.show-password-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.show-password-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.show-password-label span {
    cursor: pointer;
}

.show-password-label:hover {
    color: var(--text-secondary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 26px !important;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    color: white;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(10, 89, 145, 0.3);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, #073d66 100%);
    box-shadow: 0 6px 20px rgba(10, 89, 145, 0.4);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--border-accent);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-danger {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    border-radius: 26px !important;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #5b6270 0%, #3b4553 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-secondary-hover) 100%);
    color: white;
    border: none;
    border-radius: 26px !important;
    transition: all 0.3s;
    box-shadow: 0 4px 14px rgba(74, 144, 22, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--accent-secondary-hover) 0%, #33630f 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 22, 0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #9ca3b0;
    font-size: 0.95rem;
}

.auth-link a {
    color: var(--accent-primary);
    text-decoration: none;
}

.auth-link a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* Select Classes */
.select-classes-container {
    max-width: 1200px;
    margin: 0 auto;
}

.select-classes-container h2 {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.class-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.class-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transform: translateY(-2px);
    border-color: var(--border-accent);
}

.class-card.playing {
    border: 2px solid var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.delete-class-btn {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.delete-class-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.class-card.selectable {
    cursor: pointer;
}

.class-card.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-primary-light) 100%);
}

.class-card h3 {
    color: var(--accent-primary);
    margin: 0;
    font-size: 1.2rem;
    flex: 1;
}

.class-card .teacher {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.class-card .school {
    color: var(--accent-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.class-card .grade {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.class-card .period {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.class-card .time {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--live-red);
    border-radius: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.live-dot {
    width: 12px;
    height: 12px;
    background-color: var(--live-red);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.live-text {
    font-weight: bold;
    color: var(--live-red);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.live-controls {
    margin-bottom: 0.5rem;
}

.btn-live {
    background: linear-gradient(135deg, var(--live-red) 0%, #dc2626 100%);
    color: white;
    margin-bottom: 0.5rem;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px var(--live-red-glow);
    position: relative;
    overflow: visible;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 26px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.btn-live::before {
    content: '🔴 LIVE';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--live-red);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-live:hover {
    background: linear-gradient(135deg, #f87171 0%, var(--live-red) 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-live:active {
    transform: translateY(-1px) scale(0.98);
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

@keyframes glow-button {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.5);
    }
}

.btn-live.playing {
    animation: pulse-button-playing 1.5s infinite, glow-button-playing 1.5s infinite, pulse-scale 2s infinite;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 8px 30px rgba(248, 113, 113, 0.5), 0 0 0 0 rgba(248, 113, 113, 0.8);
}

.btn-live.playing:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 35px rgba(248, 113, 113, 0.6), 0 0 0 0 rgba(248, 113, 113, 0.8);
}

@keyframes pulse-button-playing {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(248, 113, 113, 0.5), 0 0 0 0 rgba(248, 113, 113, 0.8);
    }
    50% {
        box-shadow: 0 8px 30px rgba(248, 113, 113, 0.5), 0 0 0 15px rgba(248, 113, 113, 0);
    }
}

@keyframes glow-button-playing {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.3);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.7);
    }
}

@keyframes pulse-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.btn-stop-live {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    color: white;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    border-radius: 26px !important;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-stop-live:hover {
    background: linear-gradient(135deg, var(--danger-hover) 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn-stop-live:active {
    transform: translateY(-1px) scale(0.98);
}


/* Wave indicator */
.wave-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: var(--success-light);
    border-radius: 8px;
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}

.wave-bar {
    width: 4px;
    height: 30px;
    max-height: 30px;
    min-height: 10px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--success) 100%);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
    flex-shrink: 0;
    align-self: center;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

.wave-indicator span {
    margin-left: 0.5rem;
    color: var(--success);
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
    white-space: nowrap;
}

@keyframes wave {
    0%, 100% {
        height: 10px;
        opacity: 0.7;
    }
    50% {
        height: 30px;
        opacity: 1;
    }
}

.audio-controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-audio {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 26px !important;
}

.btn-audio:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-audio-secondary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
    color: #1a1f2a;
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 26px !important;
    font-weight: 600;
}

.btn-audio-secondary:hover {
    background: linear-gradient(135deg, var(--accent-gold-hover) 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.recordings-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.recording-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

/* Dashboard */
.dashboard-container h2 {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-group {
    margin-bottom: 3rem;
}

.school-group-header {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-primary);
}

.grade-group {
    margin-bottom: 2rem;
    margin-left: 1rem;
}

.grade-group-header {
    font-size: 1.2rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0;
}

.modal-content .form-group {
    margin-bottom: 1.5rem;
}

.modal-content .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--bg-input);
    color: var(--text-primary);
}

.modal-content .form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.modal-content .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-container h2 {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

/* Mobile Card View */
.users-mobile {
    display: none;
}

.user-card-mobile {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-primary);
}

.user-name-mobile {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.admin-actions-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-action-form-mobile {
    display: flex;
    margin: 0;
    width: 100%;
}

.admin-action-form-mobile button {
    width: 100%;
}

.btn-admin-mobile {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    white-space: nowrap;
    margin: 0;
    width: 100%;
}

.users-table thead {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.users-table tbody tr {
    transition: background-color 0.3s;
}

.users-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.users-table form {
    display: inline;
    margin-right: 0.5rem;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 300px;
    padding: 0.75rem 0;
}

.admin-action-form {
    display: flex;
    margin: 0;
    width: 100%;
}

.admin-action-form button {
    width: 100%;
}

.btn-admin {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    white-space: nowrap;
    margin: 0;
    width: 100%;
}

.users-table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-secondary);
}

.users-table td:last-child {
    padding: 1.5rem 2rem;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .school-selection {
        grid-template-columns: 1fr;
    }
    
    .classes-grid {
        grid-template-columns: 1fr;
    }
    
    .hamburger-menu {
        display: flex !important;
        order: 2;
        margin-left: auto;
    }
    
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        position: relative;
        align-items: center;
    }
    
    .site-title {
        order: 1;
        flex: 1;
    }
    
    .header-subtitle {
        position: relative;
        left: auto;
        transform: none;
        font-size: 1.25rem;
        order: 4;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    /* Hide normal navigation links on mobile - they're in the dropdown menu */
    .header-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border: 1px solid var(--border-primary);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }
    
    /* Show navigation when hamburger menu is active */
    .header-nav.active {
        display: flex !important;
    }
    
    .header-nav .nav-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    .header-nav .user-info {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        border-top: 1px solid var(--border-primary);
        margin-top: 0.5rem;
        padding-top: 0.75rem;
    }
    
    .site-title {
        order: 1;
    }
    
    .site-title img {
        height: 120px;
    }
    
    .auth-logo img {
        max-width: 100%;
    }
    
    .admin-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    .content {
        padding: 1rem;
        overflow-x: visible;
    }
    
    .desktop-table {
        display: none;
    }
    
    .users-mobile {
        display: block;
    }
    
    /* Modal mobile styles */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .modal-content h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .recording-item {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .recording-item .recording-info {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .recording-item button {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .recording-item button:last-child {
        margin-bottom: 0;
    }
    
    .recording-item div[style*="display: flex"] {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .recording-item div[style*="display: flex"] button {
        width: 100%;
        min-width: 100%;
        flex: none;
    }
    
    .close {
        font-size: 32px;
        line-height: 1;
        padding: 0.5rem;
        margin: -0.5rem -0.5rem 0 0;
    }
    
    /* Live button and indicator mobile styles */
    .btn-live {
        padding: 0.6rem;
        font-size: 0.9rem;
        border-radius: 26px !important;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-live::before {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        top: -6px;
        right: -6px;
    }
    
    .btn-stop-live {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 48px; /* Touch-friendly size */
        -webkit-tap-highlight-color: transparent;
    }
    
    .live-indicator {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
    
    .live-dot {
        width: 14px;
        height: 14px;
    }
    
    .live-text {
        font-size: 0.95rem;
    }
    
    .wave-indicator {
        padding: 0.6rem;
        min-height: 45px;
        height: 45px;
    }
    
    .wave-bar {
        width: 5px;
        max-height: 32px;
    }
    
    .wave-indicator span {
        font-size: 0.95rem;
    }
    
    /* Ensure animations work on mobile */
    .btn-live:hover {
        transform: none; /* Disable hover transform on mobile */
    }
    
    .btn-stop-live:hover {
        transform: none; /* Disable hover transform on mobile */
    }
    
    .btn-live:active {
        transform: scale(0.97);
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    }
    
    .btn-stop-live:active {
        transform: scale(0.97);
        background: linear-gradient(135deg, var(--danger-hover) 0%, #991b1b 100%);
    }
}

/* Force border-radius override for all buttons */
button.btn,
a.btn,
input.btn,
.btn,
.btn-live,
.btn-audio,
.btn-audio-secondary,
.btn-primary,
.btn-danger,
.btn-warning,
.btn-stop-live,
.btn-small {
    border-radius: 26px !important;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
