/* style.css - WERSJA KOMPLETNA */

:root {
    --primary: #e50914;      /* Netflix Red */
    --dark: #141414;         /* Background */
    --light: #1f1f1f;        /* Card Background */
    --text: #fff;
    --gray: #b3b3b3;
    --success: #46d369;
}

* { box-sizing: border-box; }

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Zapobiega poziomemu paskowi całej strony */
}

/* --- HEADER --- */
header {
    background: #000; /* Lub rgba(0,0,0,0.9) dla przezroczystości */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000; /* Musi być wyżej niż wszystko inne */
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
    text-decoration: none;
    margin-right: 20px;
}

.nav-links a, .nav-links span {
    margin-left: 20px;
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* --- WYSZUKIWARKA --- */
.search-box { position: relative; }

.search-input {
    background: #000; 
    border: 1px solid #333; 
    color: white;
    padding: 6px 10px 6px 30px; /* Miejsce na lupę (opcjonalnie) */
    border-radius: 0;
    outline: none; 
    width: 200px;
    transition: width 0.3s, border 0.3s;
}

.search-input:focus { width: 300px; border-color: var(--text); }

.search-results {
    position: absolute; top: 35px; left: 0; width: 100%;
    background: #181818; border: 1px solid #333; 
    z-index: 1001; display: none; max-height: 400px; overflow-y: auto;
}
.search-item {
    display: flex; gap: 10px; padding: 10px; cursor: pointer; border-bottom: 1px solid #333;
}
.search-item:hover { background: #333; }
.search-item img { width: 40px; height: 60px; object-fit: cover; }
.search-info { display: flex; flex-direction: column; justify-content: center; }

/* --- HERO SLIDER --- */
.hero-slider {
    position: relative;
    height: 70vh; /* Ważne: Zawsze zajmuje 70% ekranu */
    width: 100%;
    overflow: hidden;
    background: #000; /* Tło zanim załadują się zdjęcia */
}

.hero-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center top;
    opacity: 0; transition: opacity 1s ease-in-out;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-slide.active { opacity: 1; z-index: 1; }

.hero-content {
    background: linear-gradient(to top, var(--dark) 10%, transparent 100%);
    padding: 40px; 
    width: 100%; 
    padding-bottom: 80px; /* Miejsce, żeby napisy nie wchodziły pod rzędy */
}

/* --- NETFLIX ROWS --- */
#main-content {
    position: relative;
    z-index: 10;
    margin-top: -50px; /* Lekkie nasunięcie na Hero */
    padding-bottom: 50px;
}

.section-title {
    font-size: 1.2rem;
    color: #e5e5e5;
    margin: 30px 0 10px 40px;
    font-weight: bold;
}

.row-wrapper { 
    position: relative; 
    padding: 0 40px;
}

.movie-row {
    display: flex; gap: 10px;
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 20px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.movie-row::-webkit-scrollbar { display: none; }

.slider-arrow {
    position: absolute; top: 0; bottom: 0;
    width: 50px; background: rgba(0,0,0,0.5);
    color: white; border: none; font-size: 40px; cursor: pointer;
    z-index: 20; opacity: 0; transition: opacity 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.row-wrapper:hover .slider-arrow { opacity: 1; }
.arrow-left { left: 0; }
.arrow-right { right: 0; }
.slider-arrow:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }

/* --- KARTY FILMÓW --- */
.movie-card {
    min-width: 200px; max-width: 200px;
    flex: 0 0 auto;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.movie-card:hover { transform: scale(1.1); z-index: 50; }
.movie-poster { width: 100%; height: 300px; object-fit: cover; }

/* --- UI ELEMENTS (Badges, Buttons) --- */
.badge {
    position: absolute; top: 5px; right: 5px;
    padding: 4px 6px; border-radius: 4px;
    font-weight: bold; font-size: 10px;
    z-index: 5;
}
.badge-watched { background: rgba(0,0,0,0.8); color: #ffd700; border: 1px solid #ffd700; }
.badge-towatch { background: rgba(0,0,0,0.8); color: #ccc; border: 1px solid #ccc; }

.btn-action {
    border: none; padding: 8px 20px; border-radius: 4px;
    font-weight: bold; font-size: 1rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary { background: white; color: black; }
.btn-primary:hover { background: #ddd; }
.btn-dark { background: rgba(109, 109, 110, 0.7); color: white; }
.btn-dark:hover { background: rgba(109, 109, 110, 0.4); }
.btn-green { background: var(--success); color: black; }

/* --- AUTH FORM (Dla niezalogowanych) --- */
/* --- NOWY EKRAN LOGOWANIA (Split Screen) --- */

.auth-container {
    display: flex;
    height: 100vh; /* Na cały ekran */
    width: 100%;
    overflow: hidden;
    background-color: var(--dark);
}

/* LEWA STRONA (Wizualna) */
.auth-visual {
    flex: 1.5; /* Zajmuje więcej miejsca niż formularz */
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://image.tmdb.org/t/p/original/mC66fkvvZEnkuqGMvCiPqWNSzJ5.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px;
    color: white;
}

.auth-visual h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 800;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

.auth-visual p {
    font-size: 1.2rem;
    max-width: 600px;
    color: #ddd;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

/* PRAWA STRONA (Formularz) */
.auth-form-side {
    flex: 1; /* Węższa */
    background: #121212;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid #333;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    position: relative;
}

.auth-box-modern {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    margin-bottom: 40px;
}
.auth-header h2 { font-size: 2rem; margin-bottom: 10px; color: white; }
.auth-header p { color: #888; }

/* Nowoczesne Inputy */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-modern {
    width: 100%;
    padding: 15px;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-modern:focus {
    background: #252525;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}

/* Przycisk logowania */
.btn-auth-submit {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin-top: 10px;
}

.btn-auth-submit:hover {
    background: #ff1f2f;
    transform: translateY(-2px);
}

.auth-footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.link-accent {
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}
.link-accent:hover { text-decoration: underline; }

/* Mobilka - ukrywamy obrazek */
@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-form-side { border-left: none; }
}

/* --- MODAL --- */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.8);
    z-index: 2000; justify-content: center; align-items: center;
}
.modal-content {
    background: #181818; width: 800px; max-width: 95%;
    display: flex; border-radius: 10px; overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
}
.modal-poster-img { width: 40%; object-fit: cover; }
.modal-details { padding: 30px; width: 60%; position: relative; }

/* --- LOADERY --- */
.spinner {
    width: 30px; height: 30px; 
    border: 3px solid rgba(255,255,255,0.3); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s infinite linear;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 768px) {
    .modal-content { flex-direction: column; height: 80vh; overflow-y: auto; }
    .modal-poster-img { width: 100%; height: 200px; }
    .modal-details { width: 100%; }
}

/* --- STYLE DLA PODSTRON (MOJA LISTA & REKOMENDACJE) --- */

/* Kontener dla podstron - żeby nie był przyklejony do krawędzi */
.page-container {
    max-width: 1400px; 
    margin: 40px auto;
    padding: 0 20px;
    min-height: 80vh;
}

/* Siatka pionowa (dla Mojej Listy i Wyników wyszukiwania) */
.vertical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px; 
    margin-top: 30px;
}

/* Naprawa kart w siatce pionowej (żeby nie były ściśnięte jak na sliderze) */
.vertical-grid .movie-card {
    min-width: unset; /* Reset sztywnej szerokości ze slidera */
    max-width: 100%;
    width: 100%;
}

/* --- SYSTEM ZAKŁADEK (TABS) w Mojej Liście --- */
.tabs-header {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    position: relative;
    transition: color 0.3s;
}

.tab-btn:hover { color: white; }

.tab-btn.active {
    color: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px; /* Żeby pasek był na linii border-bottom */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
}

/* --- UI REKOMENDACJI (Centrowanie) --- */
.rec-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 50px;
}

.rec-controls {
    background: var(--light);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 600px;
    width: 100%;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    cursor: pointer;
    color: #ccc;
}

.checkbox-wrapper input {
    width: 20px; 
    height: 20px;
    accent-color: var(--primary);
}

/* --- NAPRAWA KART W PIONOWEJ SIATCE (MOJA LISTA / WYNIKI) --- */

.vertical-grid {
    display: grid;
    /* Karty mają min 180px, reszta się rozciąga */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Nadpisujemy style .movie-card TYLKO wewnątrz siatki pionowej */
.vertical-grid .movie-card {
    min-width: 0; /* Reset sztywnej szerokości */
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%; /* Żeby wszystkie w rzędzie były równe */
    background: #1f1f1f;
}

.vertical-grid .movie-poster {
    width: 100%;
    height: auto; 
    aspect-ratio: 2/3; 
    object-fit: cover;
}

.vertical-grid .card-content {
    padding: 10px;
    flex-grow: 1; /* Wypełnia resztę miejsca */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}