/* Humans in AI Loop - Music Player */
/* Desktop: Dust in Our Lungs style | Mobile: Touch-optimized */

:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-dim: #a0a0a0;
    --accent: #8ab4f8;
    --border: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for fixed player only */
}

/* ============================================
   DESKTOP LAYOUT
   ============================================ */

/* Header - compact with inline tabs */
.site-header {
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.site-logo {
    height: 60px;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    white-space: nowrap;
}

/* Tab menu in header */
.header-tab-menu {
    display: flex;
    gap: var(--space-sm);
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.75rem; /* Same as playlist */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: color var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: var(--text-secondary);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Hero Section - Full viewport image + playlist */
.hero-section {
    display: flex;
    height: calc(100vh - 100px); /* Compact header + fixed player */
    min-height: 500px;
    overflow: hidden;
}

.image-container {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper for image + overlay - maintains aspect ratio */
.image-with-overlay {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Lyrics Overlay - Positioned relative to image wrapper */
.lyrics-overlay {
    position: absolute;
    bottom: 8%; /* Raised from 5% */
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 80%;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    border-radius: 0;
    pointer-events: none;
    text-align: center;
    z-index: 10;
}

/* Song title above lyrics */
.song-title-overlay {
    font-size: 1.25rem; /* Same as next-line */
    color: #999; /* Light grey */
    margin-bottom: 0.5rem;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.lyric-line {
    font-size: 1.5rem; /* Back to original */
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
}

.current-line {
    color: #ffffff;
}

.next-line {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem; /* Back to original */
}

/* Playlist Sidebar */
.playlist-sidebar {
    width: 320px;
    background: rgba(0, 0, 0, 0.9);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: var(--space-lg);
    flex-shrink: 0;
}

.playlist-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: var(--space-md);
}

.playlist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.playlist-item {
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.playlist-item:hover {
    background: var(--bg-hover);
}

.playlist-item.active {
    background: rgba(138, 180, 248, 0.15);
    color: var(--accent);
}

.playlist-item-number {
    font-size: 0.875rem;
    color: var(--text-dim);
    min-width: 24px;
}

.playlist-item-title {
    font-size: 0.9375rem;
    flex: 1;
}

/* Fixed Audio Player - Compact, under playlist */
.fixed-player {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Right side, aligned with playlist */
    width: 320px; /* Same width as playlist */
    z-index: 100;
    background: rgba(60, 60, 60, 0.9); /* Dark grey instead of card color */
    border-radius: 4px;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fixed-player audio {
    width: 100%;
    height: 28px; /* Compact height */
    background: rgba(80, 80, 80, 0.8); /* Grey background for audio element */
    border-radius: 4px;
    filter: invert(0.9) hue-rotate(180deg); /* Darken the controls */
}

/* Force grey styling on audio controls */
.fixed-player audio::-webkit-media-controls-panel {
    background-color: rgba(60, 60, 60, 0.95);
}

.fixed-player audio::-webkit-media-controls-enclosure {
    background-color: transparent;
}

.fixed-player audio::-webkit-media-controls-current-time-display,
.fixed-player audio::-webkit-media-controls-time-remaining-display {
    color: #ccc;
}

/* Tab Content Area - NO scrolling on container */
.tab-content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Lyrics Tab - limit height to ~12 lines */
.lyrics-full {
    max-width: 100%; /* Full width, not restricted */
    width: 100%;
}

#lyrics-song-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    color: var(--accent);
}

.lyrics-text-content {
    font-family: 'Inter', monospace;
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word; /* Prevent horizontal overflow */
    color: var(--text-secondary);
    max-height: calc(1rem * 1.8 * 12); /* 12 lines: font-size * line-height * lines */
    overflow-y: auto; /* Only vertical scroll */
    overflow-x: hidden; /* No horizontal scroll */
    width: 100%;
}

.tab-panel h2 {
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.tab-panel h3 {
    font-size: 1.25rem;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.tab-panel p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.8;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--text-dim);
    margin-bottom: var(--space-xl);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.legal-block {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.legal-block:last-child {
    border-bottom: none;
}

/* Character list styling */
.character-list {
    margin-top: var(--space-lg);
}

.character-list p {
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.character-list strong {
    color: var(--accent);
}

.lyrics-line.highlighted {
    background: rgba(138, 180, 248, 0.25);
    color: var(--accent);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 4px;
    display: block;
}

/* Contact */
.contact-info {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: 8px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 120px;
}

/* ============================================
   MOBILE - Touch Devices
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    body {
        padding-bottom: 80px; /* Space for fixed player */
    }
    
    /* Header - compact with wrapped tabs */
    .site-header {
        padding: 0.5rem 1rem;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    /* Smaller logo on mobile */
    .site-logo {
        height: 35px;
    }
    
    .header-tab-menu {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-button {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Hero becomes stacked */
    .hero-section {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }
    
    .image-container {
        height: 250px;
        width: 100%;
        flex: none;
    }
    
    .image-with-overlay {
        width: 100%;
        height: 100%;
    }
    
    .hero-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Lyrics overlay - smaller, centered */
    .lyrics-overlay {
        bottom: 5%; /* Moved down */
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 90%;
        padding: 0; /* No background */
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    /* Smaller song title on mobile */
    .song-title-overlay {
        font-size: 0.75rem;
    }
    
    .lyric-line {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .next-line {
        font-size: 0.65rem;
    }
    
    /* Playlist below image */
    .playlist-sidebar {
        width: 100%;
        max-height: 150px;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 0.5rem;
    }
    
    .playlist-title {
        font-size: 0.625rem;
    }
    
    .playlist-item {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .playlist-item-number {
        font-size: 0.625rem;
    }
    
    .playlist-item-title {
        font-size: 0.75rem;
    }
    
    /* Fixed player - centered at bottom on mobile */
    .fixed-player {
        bottom: 10px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }
    
    .fixed-player audio {
        height: 32px;
    }
    
    /* Tab content - less padding */
    .tab-content-area {
        padding: 1rem;
    }
    
    .tab-panel h2 {
        font-size: 1.25rem;
    }
    
    .tab-panel h3 {
        font-size: 1rem;
    }
    
    .tab-panel p {
        font-size: 0.875rem;
    }
    
    .process-grid {
        grid-template-columns: 1fr;
    }
    
    /* Lyrics tab - smaller on mobile */
    .lyrics-text-content {
        font-size: 0.875rem;
        max-height: calc(0.875rem * 1.8 * 10); /* 10 lines on mobile */
    }
    
    .site-footer {
        margin-bottom: 80px;
        font-size: 0.75rem;
    }
}

/* Landscape on mobile */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
    .hero-section {
        flex-direction: row;
        height: calc(100vh - 100px);
    }
    
    .image-container {
        height: auto;
        flex: 1;
    }
    
    .image-with-overlay {
        width: 100%;
        height: 100%;
    }
    
    .playlist-sidebar {
        width: 220px;
        max-height: none;
        border-left: 1px solid var(--border);
        border-top: none;
    }
    
    .lyrics-overlay {
        max-width: 60%;
        bottom: 5%; /* Moved down, matches desktop */
    }
    
    .fixed-player {
        width: 220px;
        right: 10px;
        left: auto;
        transform: none;
    }
}

/* ============================================
   IPAD ONLY - Don't touch mobile phone CSS
   ============================================ */

/* iPad Portrait - Larger image */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (min-width: 768px) {
    .image-container {
        height: 500px; /* Much larger than phone (250px) */
    }
}

/* iPad Landscape - Fix lyrics position */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 768px) {
    .lyrics-overlay {
        bottom: 10%; /* Higher up than phones (5%) */
    }
}
