/* Books Page - Dark Cinematic Theme */

:root {
    /* Dark Theme Colors */
    --background: #0a0a0a;
    --foreground: #f5f5f5;
    --card: #1a1a1a;
    --card-foreground: #f5f5f5;
    --primary: #dab900; /* Golden accent */
    --primary-foreground: #0a0a0a;
    --secondary: #2a2a2a;
    --secondary-foreground: #f5f5f5;
    --muted: #1f1f1f;
    --muted-foreground: #a1a1a1;
    --accent: #dab900;
    --accent-foreground: #0a0a0a;
    --border: #2a2a2a;
    --charcoal: #1a1a1a;
    --warm-light: #dab900;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: #a89100;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(218, 185, 0, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-white {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-white:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-white-outline {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-white-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-reset {
    padding: 0.625rem 1.25rem;
    background-color: var(--muted);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* Section 1: Compact Hero */
.books-hero {
    position: relative;
    height: 35vh;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    background-color: var(--charcoal);
}

.hero-animated-strip {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 2rem;
    animation: slideStrip 30s linear infinite;
}

@keyframes slideStrip {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.strip-thumb {
    width: 400px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.85));
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    animation: fadeUp 0.8s ease-out;

    /* Metallic gold gradient */
    background: linear-gradient(
        to bottom,
        #ffd700 0%,      /* bright gold top */
        #ffec8b 20%,     /* lighter highlight */
        #b38d31 50%,     /* mid-tone gold */
        #ffec8b 80%,     /* lighter highlight */
        #ffd700 100%     /* bright gold bottom */
    );

    /* Clip gradient to text */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;

    /* Using filter: drop-shadow instead of text-shadow */
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.6));
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeUp 1s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section 2: Controls Bar */
.controls-bar {
    position: sticky;
    top: 73px;
    z-index: 90;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    transition: box-shadow 0.3s;
}

.controls-bar.scrolled {
    box-shadow: 0 4px 12px rgba(218, 185, 0, 0.15);
}

.controls-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background-color: var(--card);
    color: var(--foreground);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(218, 185, 0, 0.15);
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background-color: var(--card);
    color: var(--foreground);
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Section 3: Featured Trailer */
.featured-trailer {
    padding: 4rem 0;
    background-color: var(--background);
}

.featured-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(42, 42, 42, 0.6));
    border: 1px solid rgba(218, 185, 0, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.featured-video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.featured-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
}

.featured-video:hover .play-overlay {
    opacity: 1;
}

.play-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 12px rgba(218, 185, 0, 0.5));
}

.play-btn:hover {
    transform: scale(1.15);
}

.featured-info {
    padding: 2rem 3rem 2rem 0;
}

.featured-label {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background-color: var(--warm-light);
    color: var(--charcoal);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.featured-author {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.featured-hook {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.featured-buttons {
    display: flex;
    gap: 1rem;
}

/* Section 4: Trailer Grid */
.trailer-grid-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
}

.trailer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.trailer-card {
    background-color: var(--card);
    border: 1px solid rgba(218, 185, 0, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.trailer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(218, 185, 0, 0.25);
    border-color: rgba(218, 185, 0, 0.3);
}

.card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background:#000;
}

.preview-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  pointer-events: none;    /* so buttons under it are clickable */
  transition: opacity .2s ease;
}
.preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumbnail.is-playing .preview-wrap { opacity: 1; }

.thumb-image {
    position:absolute; 
    inset:0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 0;
}

.trailer-card:hover .thumb-image {
  transform: scale(1.05);
}
.card-thumbnail.is-playing .thumb-image {
  opacity: 0;
  transition: opacity .2s;
}

.genre-chip {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.75rem;
    background-color: rgba(218, 185, 0, 0.9);
    color: var(--charcoal);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    z-index: 2;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.trailer-card:hover .card-overlay {
    opacity: 1;
}

.card-hook {
    font-size: 0.9375rem;
    color: white;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.overlay-buttons {
    display: flex;
    gap: 0.75rem;
}

.card-info {
    padding: 1rem 0.75rem;
    background-color: var(--card);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.card-author {
    font-size: 0.9375rem;
    color: var(--muted-foreground);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--card);
    border-radius: 1rem;
}

.empty-state svg {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

/* Section 5: Quick Filters */
.quick-filters {
    padding: 3rem 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

.quick-filters-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1.5rem;
    text-align: center;
}

.theme-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.theme-chip {
    padding: 0.625rem 1.5rem;
    background-color: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-chip:hover,
.theme-chip.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 185, 0, 0.3);
}

/* Section 6: Collaborate Banner */
.collaborate-banner {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--charcoal) 0%, #2d2d2d 100%);
    position: relative;
    overflow: hidden;
}

.collaborate-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(218, 185, 0, 0.02) 2px,
        rgba(218, 185, 0, 0.02) 4px
    );
    animation: filmGrain 8s steps(10) infinite;
}

@keyframes filmGrain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0); }
    70% { transform: translate(0, 10%); }
    80% { transform: translate(-15%, 0); }
    90% { transform: translate(10%, 5%); }
}

.collaborate-banner .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.banner-content {
    color: white;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;

    /* Metallic gold gradient */
    background: linear-gradient(
        to bottom,
        #ffd700 0%,      /* bright gold top */
        #ffec8b 20%,     /* lighter highlight */
        #b38d31 50%,     /* mid-tone gold */
        #ffec8b 80%,     /* lighter highlight */
        #ffd700 100%     /* bright gold bottom */
    );

    /* Clip gradient to text */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;

    /* Filter provides a cleaner shadow for clipped text than text-shadow does */
    filter: drop-shadow(0 2px 4px rgba(62, 12, 16, 0.4));
}

.banner-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

.banner-illustration {
    display: flex;
    justify-content: center;
}

.banner-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(218, 185, 0, 0.2);
}

/* Trailer Modal */
.trailer-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.trailer-modal.active {
    display: flex;
}
.card-thumbnail .yt-wrap { position:absolute; inset:0; display:none; pointer-events:none; }
.trailer-card:hover .yt-wrap { display:block; }
.card-thumbnail iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.thumb-image { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:opacity .2s; }


.tm-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.6); }

.tm-dialog { 
    position:relative; 
    margin:5vh auto; 
    width:  min(96vw, calc(16 / 9 * 86vh));
    height: min(86vh, calc(9 / 16 * 96vw));
    aspect-ratio:16/9; 
    max-width: none;
    max-height: none;
    overflow: hidden;
    background:#000; 
    border-radius:12px; 
    box-shadow:0 20px 60px rgba(0,0,0,.5); 
}

.tm-player { position:absolute; inset:0; }
.tm-close { position:absolute; top:8px; right:10px; z-index:2; background:rgba(0,0,0,.5); color:#fff; border:0; width:36px; height:36px; border-radius:50%; cursor:pointer; font-size:22px; line-height:36px; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 201;
    background-color: var(--card);
    border: 1px solid rgba(218, 185, 0, 0.2);
    border-radius: 1rem;
    max-width: 1000px;
    width: min(96vw, calc(16 / 9 * 86vh));
    max-width: none;
    max-height: 90vh;
    margin-top: 70px;
    overflow-y: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 202;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(218, 185, 0, 0.9);
    color: var(--charcoal);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.modal-close:hover {
    background-color: var(--primary);
    transform: scale(1.1);
}

.modal-video{

  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.modal-video video{
  display: block;            /* remove inline-gap */
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;       /* keep full frame visible */
}

.video-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.video-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 12px rgba(218, 185, 0, 0.5));
}

.video-play-btn:hover {
    transform: scale(1.15);
}

.modal-info {
    padding: 2rem;
    background-color: var(--card);
    max-height: 18vh;          /* adjust to taste */
    overflow-y: auto;
    overflow-x: hidden;
}

.trailer-modal *{
  box-sizing: border-box;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.modal-author {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.modal-genre {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background-color: rgba(218, 185, 0, 0.15);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.25rem;
    border: 1px solid rgba(218, 185, 0, 0.3);
    margin-bottom: 1rem;
}

.modal-synopsis {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .featured-card {
        grid-template-columns: 1fr;
    }
    
    .featured-info {
        padding: 2rem;
    }
    
    .collaborate-banner .container {
        grid-template-columns: 1fr;
    }
    
    .trailer-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-controls {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .filter-select {
        flex: 1;
    }
    
    .trailer-grid {
        grid-template-columns: 1fr;
    }
    
    .banner-title {
        font-size: 1.75rem;
    }
    
    .banner-text {
        font-size: 1rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-animated-strip {
        animation: none;
    }
}

