/**
 * style.css - MovieSelector.fun
 * Core styles for mobile optimization, animations, and modal handling.
 */

:root {
    --amber-500: #f59e0b;
    --accent: #c5a059;
    --bg-dark: #0a0a0b;
    --modal-bg: #0f0f11;
    --card-ratio: 2/3;
}

/* 1. Base reset & Typography */
body {
    background-color: var(--bg-dark);
    color: #fff;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.8s ease;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
}

.cinzel {
    font-family: 'Cinzel', serif;
}

/* Fluid Typography */
h1 {
    font-size: clamp(2rem, 8vw, 4rem);
}

.movie-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    line-height: 1.1;
    font-weight: 900;
}

/* 2. Button States & Interactive Elements */

/* Active Deck Size Button Styling */
.slot-btn.active {
    border-color: var(--amber-500) !important;
    background-color: rgba(245, 158, 11, 0.1);
    color: white;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
    transform: translateY(-2px);
}

/* Genre Pills */
.genre-pill {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.genre-pill.active {
    background-color: var(--amber-500);
    color: black;
    border-color: var(--amber-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* 3. Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 4. Card Reveal System (The Shuffle Screen) */
.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.movie-card {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.movie-card:hover {
    transform: translateY(-12px) scale(1.05);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Animation for when the card is flipped */
.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, #1a1a1c 0%, #0a0a0b 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.card-back {
    transform: rotateY(180deg);
    background-color: #000;
    border: 2px solid var(--amber-500);
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 5. Modals & Overlays */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.modal-content {
    max-height: 92vh;
    width: 95%;
    max-width: 960px;
    background: var(--modal-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 6. Atmospheric Visual Effects */
#vibe-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120vw;
    height: 120vh;
    z-index: -1;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    pointer-events: none;
    transition: opacity 1.8s ease, background-color 1.8s ease;
}

#dynamic-bg {
    filter: brightness(0.3);
}

/* 7. Trailer System */
#trailer-modal {
    background: rgba(0, 0, 0, 0.98);
}

#trailer-iframe {
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    background: #000;
}

/* 8. Mobile & Responsive Adjustments */
@media (max-width: 1024px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 640px) {
    .movie-card {
        width: 140px;
        height: 210px;
    }

    .card-front {
        font-size: 1.8rem;
    }

    /* Prevent text selection during quick taps */
    * {
        -webkit-user-select: none;
        user-select: none;
    }
    
    input, textarea {
        -webkit-user-select: text;
        user-select: text;
    }
}