* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: 'SuperMystery';
    src: url('Font/SuperMysteryFont.ttf');
    font-weight: normal;
    font-style: normal;
}

body {
    background-color: #0a0a0a; /* Trochu hlubší černá */
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

h1 {
    font-family: 'SuperMystery', sans-serif;
    color: #ed1c24; /* Hororová červená */
    font-size: 4em;
    text-shadow: 0 0 15px rgba(237, 28, 36, 0.5);
    letter-spacing: 5px;
}

.line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #ed1c24, transparent);
    width: 100%;
    margin: 15px 0;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.tabs a {
    cursor: pointer;
    font-size: 1.2em;
    color: #888;
    transition: 0.3s;
    text-decoration: none;
}

.tabs a.active, .tabs a:hover {
    color: #ed1c24;
    text-shadow: 0 0 5px #ed1c24;
}

/* Vyhledávání */
.search-bar {
    margin-bottom: 40px;
}

.search-bar input {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    width: 300px;
    outline: none;
    transition: 0.3s;
}

.search-bar input:focus {
    border-color: #ed1c24;
    box-shadow: 0 0 10px rgba(237, 28, 36, 0.3);
}

/* Grid s filmy */
.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1200px;
}

.film-card {
    background: #151515;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #222;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.film-card:hover {
    transform: translateY(-5px);
    border-color: #444;
}

.film-header {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
}

.film-header a {
    text-decoration: none;
}

/* Základní stav obou obrázků */
.btn-edit img,
.delete-btn img {
    display: block; /* Proti textovým okrajům */
    transition: transform 0.2s ease, filter 0.2s ease; /* Plynulost pro oba */
    
    /* Vynucení GPU (Obrana proti rozmazání) */
    backface-visibility: hidden; 
    transform: translateZ(0);
    will-change: transform;
}

/* Specifické nastavení pro edit button (je v základu tmavá) */
.btn-edit img {
    filter: invert(1) brightness(0.8); /* Udělá ji bílo-šedou */
    margin-top: 2px; /* Jemné vertikální srovnání */
}

/* Hover na edit (generuje vivid červenou) */
.btn-edit:hover img {
    transform: scale(1.1) translateZ(0);
    filter: invert(18%) sepia(87%) saturate(5151%) hue-rotate(348deg) brightness(97%) contrast(93%);
}

/* Hover na delete */
.delete-btn:hover img {
    transform: scale(1.1) translateZ(0);
    
    /* Zvýšení sytosti při hoveru -> cílem je se přiblížit edit buttonu */
    filter: saturate(200%); 
}

.edit-buttons {
    display: flex;
    align-items: center;
    gap: 7px;
}

.edit-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.poster-wrapper {
    position: relative;
    height: 420px; /* Filmové plakáty jsou obdélníky na výšku. 420px jim sedne líp než 350px. */
    background-color: #0d0d0d; /* Ultra tmavé pozadí, které tam je, než API plakát vůbec dodá */
    border-bottom: 1px solid #222; /* Decentní linka, co oddělí obrázek od popisku */
    overflow: hidden; 
}

.film-poster {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center top; /* U plakátů je důležitý střed a vršek. Spodek se dá oříznout. */
    transition: transform 0.5s ease, filter 0.5s ease; /* Plynulá příprava pro animaci */
}

.film-card:hover .film-poster {
    transform: scale(1.08); /* Jemný zoom dovnitř */
    filter: brightness(0.8); /* Trochu se ztlumí, ať vyniknou ty červené texty dole */
}

.year {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(237, 28, 36, 0.8);
    padding: 2px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.film-info {
    padding: 20px;
}

.film-info h3 {
    color: #ed1c24;
    font-size: 1.5em;
}

.description {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.4;
}

.text-reviews {
    font-size: 0.9em;
    font-style: italic;
    color: #ccc;
}
.review {
    margin-bottom: 10px;
}

/* Prázdná zpráva */
.empty-message {
    grid-column: 1 / -1; /* Roztáhne se přes celou mřížku karet */
    text-align: center;
    padding: 50px 20px;
    color: #ed1c24; /* Hororová červená */
    text-shadow: 0 0 15px rgba(237, 28, 36, 0.5);
    letter-spacing: 5px;
}

.empty-message p {
    font-size: 2em;
    margin-bottom: 10px;
    font-family: 'SuperMystery', sans-serif;
}

/* Zobrazení popisku */
.description-container summary {
    cursor: pointer;
    font-weight: bold;
    color: #ff4d4d; 
    padding: 10px 0;
    outline: none;
    list-style: none; /* Schová výchozí šipku v některých prohlížečích */
}

/* Přidání vlastní šipky před text */
.description-container summary::before {
    content: '▶ ';
    font-size: 0.8em;
    transition: transform 0.2s;
    display: inline-block;
}

/* Otočení šipky při otevření */
details[open] summary::before {
    transform: rotate(90deg);
}

/* Styl pro samotný text popisu */
.description-content {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.description-container {
    margin-bottom: 10px;
}

/* Bubliny s hodnocením */
.ratings {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;

    /*
        /* Uprava výšky komentářů + scrollbar 
        max-height: 300px;
        overflow-y: auto;
        padding-right: 10px; /* Pro prostor pro scrollbar 

        /* Firefox 
            scrollbar-width: thin;
            scrollbar-color: #ed1c24 #0a0a0a;

        /* Stylování scrollbaru 
        /* Safari/Edge/Chrome 
        .ratings::-webkit-scrollbar {
            width: 6px;
        }

        .ratings::-webkit-scrollbar-track {
            background: #0a0a0a;
        }

        .ratings::-webkit-scrollbar-thumb {
            background: #ed1c24;
            border-radius: 10px;
        }
    */
}

.reviews-container {
    margin-top: 10px;
    width: 100%;
}

.reviews-container summary {
    color: #888; 
    font-size: 0.9em;
    transition: color 0.2s ease;
    list-style: none;
}

.reviews-container summary::before {
    content: '▶ ';
    font-size: 0.8em;
    transition: transform 0.2s;
    display: inline-block;
}

.reviews-container summary:hover {
    color: #ed1c24; 
}

.reviews-container[open] .text-reviews {
    background: rgba(255, 255, 255, 0.05); 
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    border-top: none; /* Zrušíme starou horní čáru, v téhle bublině už není potřeba */
}

.rating-bubble {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.rating-bubble.honza {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid #007bff;
}

.rating-bubble.barca {
    background: rgba(255, 0, 150, 0.1);
    border: 1px solid #ff0096;
}

.author {
    font-size: 0.7em;
    text-transform: uppercase;
    margin-bottom: 3px;
    color: #eee;
}

.score {
    font-weight: bold;
    font-size: 1.1em;
}

footer {
    margin-top: 50px;
    padding: 20px;
    color: #555;
    font-size: 0.8em;
}

/* ---------------------------
        AddForm.css 
--------------------------- */
/* Kontejner pro celý formulář */
.addform h1 {
    margin-bottom: 10px;
}

.addform a {
    text-decoration: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #888;
    transition: 0.3s;
    text-decoration: none;
}

.addform a:hover {
    color: #ed1c24;
    text-shadow: 0 0 5px #ed1c24;
}

.add-form {
    background: #151515;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #222;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Nadpisy v sekcích (Honza/Barča) */
.add-form h3 {
    font-family: 'SuperMystery', sans-serif;
    color: #ed1c24;
    margin: 25px 0 15px 0;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(237, 28, 36, 0.2);
    padding-bottom: 5px;
}

/* Společný styl pro inputy a textarey */
.add-form input[type="text"],
.add-form input[type="number"],
.add-form textarea {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    transition: 0.3s;
}

/* Efekt při kliknutí do políčka */
.add-form input:focus,
.add-form textarea:focus {
    border-color: #ed1c24;
    box-shadow: 0 0 10px rgba(237, 28, 36, 0.2);
}

/* Textarea (popis a komentáře) */
.add-form textarea {
    height: 100px;
    resize: vertical;
}

/* Stylování radio buttonů (Stav) */
.status-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
}

.status-selection label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    transition: 0.3s;
}

.status-selection input[type="radio"]:checked + span, 
.status-selection label:hover {
    color: #ed1c24;
}

/* Hlavní odesílací tlačítko */
.add-form button[type="submit"] {
    width: 100%;
    background: #ed1c24;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
}

.add-form button[type="submit"]:hover {
    background: #ff2e38;
    box-shadow: 0 0 20px rgba(237, 28, 36, 0.4);
    transform: scale(1.02);
}

/* Odkaz zpět */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #666;
    text-decoration: none;
    transition: 0.3s;
}

.back-link:hover {
    color: #ed1c24;
}

/* Čára pro oddělení sekcí */
hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #333, transparent);
    margin: 30px 0;
}