:root {
    --primary-gold: #d4af37;
    --primary-gold-light: #f4d160;
    --primary-red: #c41e3a;
    --primary-red-dark: #8b0000;
    --bg-dark: #0a0a0f;
    --bg-card: #141420;
    --bg-card-light: #1a1a2e;
    --text-light: #f5f5f5;
    --text-muted: #a0a0a0;
    --accent-blue: #4a9eff;
    --accent-purple: #8b5cf6;
    --shadow-gold: rgba(212, 175, 55, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Film Grain Overlay ===== */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grain 0.5s steps(1) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-1%, 1%); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-1%, 0); }
    60% { transform: translate(1%, 0); }
    70% { transform: translate(0, 1%); }
    80% { transform: translate(0, -1%); }
    90% { transform: translate(1%, 1%); }
}

/* ===== Spotlight Effect ===== */
.spotlight {
    position: fixed;
    top: -50%;
    left: 50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: spotlightMove 10s ease-in-out infinite;
    z-index: 1;
}

@keyframes spotlightMove {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

/* ===== Film Strip Decorations ===== */
.film-strip {
    position: fixed;
    top: 0;
    width: 60px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        #1a1a2e 0px,
        #1a1a2e 20px,
        #0a0a0f 20px,
        #0a0a0f 25px,
        #1a1a2e 25px,
        #1a1a2e 80px,
        #0a0a0f 80px,
        #0a0a0f 85px
    );
    z-index: 2;
    opacity: 0.5;
}

.film-strip::before {
    content: '';
    position: absolute;
    top: 0;
    width: 15px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 30px,
        rgba(212, 175, 55, 0.3) 30px,
        rgba(212, 175, 55, 0.3) 50px,
        transparent 50px,
        transparent 80px
    );
}

.film-strip.left {
    left: 0;
    border-right: 3px solid var(--primary-gold);
}

.film-strip.left::before {
    right: 10px;
}

.film-strip.right {
    right: 0;
    border-left: 3px solid var(--primary-gold);
}

.film-strip.right::before {
    left: 10px;
}

/* ===== Header ===== */
header {
    position: relative;
    z-index: 10;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-bottom: 2px solid var(--primary-gold);
    margin-bottom: 30px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.film-reel {
    font-size: 4rem;
    animation: reelSpin 3s linear infinite;
    filter: drop-shadow(0 0 20px var(--shadow-gold));
}

@keyframes reelSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-light) 50%, var(--primary-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.tagline {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-gold);
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.star {
    color: var(--primary-gold);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.subtitle {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ===== Main Content ===== */
main {
    position: relative;
    z-index: 10;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 80px 40px;
}

/* ===== Input Section ===== */
.input-section {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 
        0 20px 60px var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold), var(--primary-red));
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: var(--primary-gold);
}

.clapperboard {
    font-size: 1.5rem;
    animation: clap 2s ease-in-out infinite;
}

@keyframes clap {
    0%, 90%, 100% { transform: rotate(0deg); }
    95% { transform: rotate(-10deg); }
}

/* ===== Settings Grid ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.input-group select,
.input-group input[type="number"] {
    width: 100%;
    padding: 15px;
    background: var(--bg-dark);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-group select:hover,
.input-group input[type="number"]:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 0 20px var(--shadow-gold);
}

.input-group select:focus,
.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 30px var(--shadow-gold);
}

.input-group select option {
    background: var(--bg-dark);
    padding: 10px;
}

/* ===== Textarea ===== */
.textarea-wrapper {
    position: relative;
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    height: 180px;
    padding: 20px;
    background: var(--bg-dark);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.6;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea:hover {
    border-color: var(--primary-gold);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 40px var(--shadow-gold);
}

.textarea-glow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

textarea:focus ~ .textarea-glow {
    opacity: 1;
}

/* ===== Generate Button ===== */
.generate-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    border: none;
    border-radius: 15px;
    color: white;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 
        0 10px 30px rgba(196, 30, 58, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.generate-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-button:hover::before {
    left: 100%;
}

.generate-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(196, 30, 58, 0.5),
        0 0 60px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #d62748 0%, var(--primary-red) 100%);
}

.generate-button:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.8rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.btn-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generate-button:hover .btn-shine {
    opacity: 1;
}

/* ===== Loading State ===== */
#loading {
    margin-top: 30px;
    text-align: center;
}

.loading-content {
    padding: 30px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.film-loader {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.reel {
    font-size: 3rem;
    animation: reelRotate 1s linear infinite;
}

.reel-2 {
    animation-direction: reverse;
}

@keyframes reelRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-content p {
    color: var(--primary-gold);
    font-size: 1.1rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.loading-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold), var(--primary-red));
    background-size: 200% 100%;
    animation: loadingMove 1.5s ease-in-out infinite;
    border-radius: 3px;
}

@keyframes loadingMove {
    0% { transform: translateX(-100%); background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { transform: translateX(400%); background-position: 0% 50%; }
}

/* ===== Output Section ===== */
.output-section {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-light) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-dark);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-section h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 4px;
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 30px var(--shadow-gold);
}

.output-section > p {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.output-section h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--primary-gold);
    margin-bottom: 20px;
}

/* ===== Scene Cards ===== */
.scene-card {
    background: linear-gradient(145deg, rgba(20, 20, 32, 0.8), rgba(26, 26, 46, 0.8));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-left: 5px solid var(--primary-red);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scene-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1), transparent);
    pointer-events: none;
}

.scene-card:hover {
    transform: translateX(10px);
    border-left-color: var(--primary-gold);
    box-shadow: 0 10px 40px var(--shadow-dark);
}

.scene-card h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: var(--primary-gold);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.scene-card h3::before {
    content: '🎬';
}

.scene-card p {
    margin: 12px 0;
    line-height: 1.7;
    color: var(--text-light);
}

.scene-card p strong {
    color: var(--primary-gold);
    margin-right: 8px;
}

.scene-card em {
    color: var(--accent-blue);
    font-style: italic;
}

/* ===== Visual Link ===== */
.visual-link-wrapper {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(212, 175, 55, 0.2);
}

.visual-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.visual-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

/* ===== Footer ===== */
footer {
    position: relative;
    z-index: 10;
    padding: 30px 20px;
    text-align: center;
    border-top: 2px solid var(--primary-gold);
    background: linear-gradient(0deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.footer-film-strip {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 1px;
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .film-strip {
        display: none;
    }
    
    main {
        padding: 0 20px 40px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .input-section {
        padding: 25px;
    }
    
    .generate-button {
        font-size: 1.2rem;
        padding: 15px 25px;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-gold), var(--primary-red));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-gold-light), var(--primary-red));
}
