/* ==========================================================================
   Design C: "Warm" - Bandcamp-inspired, artist-centric
   Multi-page version
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Theme Variables)
   ========================================================================== */

:root {
    --bg: #1a1d2e;
    --surface: #242838;
    --surface-hover: #2d3347;
    --border: #3a3f54;
    --text: #f0ede5;
    --text-muted: #9a97a8;
    --accent: #ff6b5b;
    --accent-hover: #ff5545;
    --accent-soft: #ffd4cf;
    --cream: #fff8f0;
    --success: #4caf50;
    --error: #f44336;
    --font-display: 'Georgia', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   2. Base / Reset
   ========================================================================== */

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   3. Utility Classes
   ========================================================================== */

.hidden { display: none !important; }
.visible { display: block; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   4. Layout Components
   ========================================================================== */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   5. Header & Navigation
   ========================================================================== */

header {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
}

.logo-text {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    text-decoration: none;
}

.nav-cta {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.nav-cta:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

/* ==========================================================================
   6. Hero Section
   ========================================================================== */

.hero {
    padding: 80px 0 0;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 107, 91, 0.15);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
}

.hero-cta {
    display: inline-block;
    padding: 16px 40px;
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 91, 0.3);
    text-decoration: none;
}

/* ==========================================================================
   7. Featured Card
   ========================================================================== */

.featured {
    padding: 24px 0 60px;
}

.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    align-items: center;
}

.featured-image {
    background: var(--surface-hover);
    border-radius: 12px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-card-centered {
    display: block;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.featured-image-large {
    aspect-ratio: 4/5;
    border-radius: 12px;
}

.featured-caption {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.featured-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 12px;
}

.featured-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 8px;
}

.featured-artist {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.featured-description {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

.featured-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.featured-price {
    display: flex;
    align-items: center;
    gap: 16px;
}

.price-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--cream);
}

/* ==========================================================================
   8. Browse Grid
   ========================================================================== */

.browse {
    padding: 60px 0;
}

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

.section-title {
    font-family: var(--font-display);
    font-size: 24px;
}

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

.filter-tab {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--surface);
    border-color: var(--text-muted);
    color: var(--text);
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.content-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.content-thumbnail {
    aspect-ratio: 16/9;
    background: var(--surface-hover);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.content-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.content-card:hover .content-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.content-details {
    padding: 20px;
}

.content-details h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.content-year {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.content-artist {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.content-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 18px;
}

.content-runtime {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   9. Title Detail Page
   ========================================================================== */

.title-hero {
    padding: 60px 0;
}

.title-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.title-poster {
    aspect-ratio: 5/8;  /* 625x1000 vertical format */
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

.title-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
}

.title-info h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.title-year {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.title-creator {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 24px;
}

.title-description {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 24px;
}

.title-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.title-cast {
    margin-bottom: 32px;
}

.title-cast h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.title-cast p {
    color: var(--text);
}

.title-purchase {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--surface);
    border-radius: 12px;
}

.title-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cream);
}

/* ==========================================================================
   10. Buttons
   ========================================================================== */

.btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn.primary,
.buy-btn {
    padding: 14px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn.primary:hover,
.buy-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 91, 0.3);
    text-decoration: none;
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn.secondary:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   11. Access Code Section
   ========================================================================== */

.access,
.redeem-section {
    padding: 60px 0;
}

.redeem-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.redeem-card h1 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text);
}

.redeem-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.redeem-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 320px;
    margin: 0 auto;
}

.access-input,
#access-code {
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    text-align: center;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.access-input:focus,
#access-code:focus {
    outline: none;
    border-color: var(--accent);
}

/* ==========================================================================
   12. Success Section
   ========================================================================== */

.success-section {
    padding: 60px 24px;
}

.success-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    color: white;
}

.success-card h1 {
    font-family: var(--font-display);
    font-size: 28px;
    margin-bottom: 16px;
}

.success-message {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.email-confirmation {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding: 16px;
    background: rgba(255, 107, 91, 0.1);
    border-radius: 8px;
}

.email-confirmation strong {
    color: var(--text);
    font-weight: 600;
}

.access-code-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.access-code-box {
    background: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--text);
    margin: 20px 0;
}

.watch-now-message {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 16px;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.loading-spinner {
    color: var(--text-muted);
    padding: 20px;
}

/* ==========================================================================
   13. Video Player Section
   ========================================================================== */

.player-section {
    padding: 40px 24px;
}

.player-section .container {
    max-width: 1000px;
    margin: 0 auto;
}

.video-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

#video-player {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.cast-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
}

.cast-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.cast-btn:hover {
    background: var(--accent-hover);
}

.cast-icon {
    font-size: 1.2rem;
}

.cast-status {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cast-status.connected {
    color: var(--success);
}

.cast-controls-bar {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 15px;
    background: rgba(255, 107, 91, 0.1);
    border: 1px solid rgba(255, 107, 91, 0.3);
    border-radius: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.cast-control-btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.cast-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#cast-stop {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
}

#cast-stop:hover {
    background: rgba(244, 67, 54, 0.3);
}

.content-info {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
}

.content-info h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.content-info p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.artist-info {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 500;
}

.artist-info span {
    color: var(--cream);
}

.firefox-cast-info,
.cast-fallback-info {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.firefox-cast-info p,
.cast-fallback-info p {
    margin-bottom: 10px;
    color: var(--text);
}

.firefox-cast-info a {
    color: var(--accent);
}

/* ==========================================================================
   14. Messages & Errors
   ========================================================================== */

.message,
.error {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.message {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: var(--success);
}

.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: var(--error);
}

#error-display {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    z-index: 1000;
}

/* ==========================================================================
   15. Back Links & Prompts
   ========================================================================== */

.back-link {
    margin-top: 24px;
    text-align: center;
}

.back-link a {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
}

.back-link a:hover {
    text-decoration: underline;
}

.redeem-prompt {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 12px;
}

.redeem-prompt a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.redeem-prompt a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   16. Footer
   ========================================================================== */

footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--text);
}

/* ==========================================================================
   17. Loading States
   ========================================================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   18. Media Queries
   ========================================================================== */

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 16px;
    }

    nav {
        gap: 16px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero {
        padding: 60px 0;
    }

    .featured-card {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 24px;
    }

    .featured-title {
        font-size: 1.5rem;
    }

    .title-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .title-info h1 {
        font-size: 1.8rem;
    }

    .title-purchase {
        flex-direction: column;
        text-align: center;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .redeem-form {
        width: 100%;
    }

    footer .container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .success-card {
        padding: 40px 24px;
    }

    .access-code-box {
        font-size: 1.2rem;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }

    .cast-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .cast-controls-bar {
        flex-direction: column;
    }

    .cast-control-btn {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .filter-tabs {
        display: none;
    }
}
