/* --- GEN Z VIBES --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #050505;
    --acid-green: #ccff00;
    --hot-pink: #ff00ff;
    --electric-blue: #00ffff;
    --text-main: #ffffff;
    --text-muted: #888888;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --blur-amount: 24px;
    --radius-lg: 32px;
    --radius-sm: 16px;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* --- BACKGROUND FX --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -2;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.blob-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: var(--hot-pink); animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 600px; height: 600px; background: var(--electric-blue); animation-delay: -2s; }
.blob-3 { top: 40%; left: 40%; width: 400px; height: 400px; background: var(--acid-green); opacity: 0.4; animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* --- CONTAINERS --- */
.main-container {
    width: 100%;
    max-width: 1000px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.5);
    display: none;
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Rainbow border effect */
.main-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, var(--acid-green), var(--hot-pink), var(--electric-blue));
    opacity: 0.5;
}

#login-screen {
    text-align: center;
    width: 100%;
    max-width: 420px;
    padding: 60px 40px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(40px);
    z-index: 100;
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(60px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.brand-header h1 {
    font-size: 4rem;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2em;
    line-height: 0.9;
}

.brand-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* --- CONTROLS --- */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--acid-green);
    font-family: var(--font-display);
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select, input {
    width: 100%;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
    color: white;
    font-family: var(--font-body);
    font-size: 1.1em;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
}

select:hover, input:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

select:focus, input:focus {
    border-color: var(--acid-green);
    box-shadow: 0 0 20px rgba(204, 255, 0, 0.1);
}

.find-btn {
    grid-column: 1 / -1;
    padding: 24px;
    background: var(--acid-green);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 1.5em;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.find-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.find-btn:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 0 30px var(--acid-green);
}

.find-btn:hover::after {
    transform: translateX(100%);
}

/* --- MOVIE CARD --- */
#movie-card {
    display: none;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    animation: fadeIn 0.6s ease-out;
}

.movie-layout {
    display: flex;
    flex-direction: column;
}

@media (min-width: 800px) {
    .movie-layout { flex-direction: row; }
}

#poster {
    width: 100%;
    max-width: 400px;
    object-fit: cover;
    aspect-ratio: 2/3;
}

.movie-info {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#title {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.meta-row {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.rating-badge {
    background: var(--hot-pink);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.9em;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

.year-badge {
    border: 1px solid var(--text-muted);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9em;
    font-weight: 500;
}

#overview {
    color: #ccc;
    line-height: 1.6;
    font-size: 1.1em;
    margin-bottom: 40px;
    flex-grow: 1;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.watch-btn {
    flex: 2;
    padding: 16px 30px;
    background: white;
    color: black;
    border: none;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.watch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.4);
}

.btn-secondary {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* --- USER & HISTORY --- */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 15px 25px;
    background: rgba(255,255,255,0.03);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--acid-green);
}

.sign-out-btn {
    background: transparent;
    border: 1px solid #ff4b5c;
    color: #ff4b5c;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8em;
    transition: 0.3s;
}

.sign-out-btn:hover {
    background: #ff4b5c;
    color: white;
    box-shadow: 0 0 15px rgba(255, 75, 92, 0.4);
}

.watched-section {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.watched-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.watched-header h3 {
    font-size: 1.2em;
    color: var(--text-muted);
}

.clear-btn {
    color: var(--text-muted);
    background: transparent;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
}

.clear-btn:hover { color: white; }

.watched-item {
    padding: 15px;
    background: rgba(255,255,255,0.02);
    margin-bottom: 8px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    transition: 0.2s;
    border: 1px solid transparent;
}

.watched-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

/* --- UTILS --- */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px;
    background: white;
    color: black;
    font-family: var(--font-display);
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 30px;
    transition: 0.3s;
}

.google-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255,255,255,0.3);
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--acid-green);
    animation: spin 1s ease-in-out infinite;
    margin: 40px auto;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Mobile tweaks */
@media (max-width: 600px) {
    .brand-header h1 { font-size: 3rem; }
    .main-container { padding: 20px; }
    .movie-info { padding: 20px; }
    #title { font-size: 2rem; }
}
