/* Import moderního a dobře čitelného písma z Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fredoka:wght@400;500;600&display=swap');

/* Animace pro bublinky piva */
@keyframes bubbleFloat {
    0% {
        transform: translateY(0px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px);
        opacity: 1;
    }
    100% {
        transform: translateY(-40px);
        opacity: 0;
    }
}

.years-grid a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.years-grid a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@keyframes beerPour {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes beerFoam {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.1); }
}

@keyframes hoverBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Základní styly a motiv piva pro celou stránku */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #2C1810 0%, #5D4037 25%, #3E2723 50%, #1A0E0A 100%);
    background-attachment: fixed;
    color: #f2f2f2;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

#beerMatrix {
    position: fixed; /* Zůstane na místě i při scrollování */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: #1a1a1a;
}

.container {
    background: rgba(255, 255, 255, 0.85); /* Trochu víc průhlednosti, ať je matrix vidět */
    position: relative;
    z-index: 1;
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Animované bublinky na pozadí */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 191, 0, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 40%, rgba(255, 191, 0, 0.15) 3px, transparent 3px),
        radial-gradient(circle at 40% 80%, rgba(255, 191, 0, 0.08) 2px, transparent 2px),
        radial-gradient(circle at 90% 10%, rgba(255, 191, 0, 0.12) 4px, transparent 4px);
    background-size: 300px 300px, 400px 400px, 350px 350px, 500px 500px;
    animation: bubbleFloat 8s infinite linear;
    pointer-events: none;
    z-index: -1;
}

/* Kontejner pro vycentrování obsahu */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 40px;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 20, 0.8));
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 191, 0, 0.2);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffbf00, transparent, #ffbf00);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
}

/* Styl pro hlavní nadpis */
h1 {
    font-family: 'Fredoka', sans-serif;
    text-align: center;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #ffbf00 0%, #ffd700 50%, #ffbf00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin: 0 0 30px 0;
    position: relative;
}

h1::after {
    content: '🍺';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    animation: hoverBounce 2s infinite;
}

/* Kontejner pro celkový počet piv s pivním sklem */
.total-count-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: linear-gradient(135deg, rgba(255, 191, 0, 0.15) 0%, rgba(255, 191, 0, 0.05) 100%);
    padding: 25px 35px;
    border-radius: 15px;
    margin: 30px 0;
    border: 2px solid rgba(255, 191, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.total-count-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 191, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-link:hover .total-count-container::before {
    left: 100%;
}

.total-count-container .beer-glass {
    width: 80px;
    height: 120px;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, transparent 20%, #ffbf00 20%, #ffbf00 85%, #fff 85%, #fff 100%);
    border-radius: 0 0 10px 10px;
    border: 3px solid #ddd;
    border-top: none;
    animation: beerPour 2s ease-in-out;
}

.total-count-container .beer-glass::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -3px;
    right: -3px;
    height: 15px;
    background: #fff;
    border-radius: 15px 15px 0 0;
    border: 3px solid #ddd;
    border-bottom: none;
    animation: beerFoam 3s ease-in-out infinite;
}

.total-count-text h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #bbb;
    font-weight: 500;
    font-family: 'Fredoka', sans-serif;
}

.total-count-text p {
    margin: 5px 0 0 0;
    font-size: 3rem;
    font-weight: 700;
    color: #ffbf00;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
}

/* Moderní vzhled tabulky */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 30px;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Hlavička tabulky */
thead tr {
    background: linear-gradient(135deg, #ffbf00 0%, #e6ac00 100%);
    color: #1a1a1a;
}

th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th:first-child {
    border-radius: 15px 0 0 0;
}

th:last-child {
    border-radius: 0 15px 0 0;
}

/* Řádky v těle tabulky */
tbody tr {
    transition: all 0.3s ease;
    position: relative;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(255, 191, 0, 0.1), rgba(255, 191, 0, 0.2), rgba(255, 191, 0, 0.1));
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 191, 0, 0.2);
}

tbody tr:nth-of-type(even) {
    background: rgba(255, 255, 255, 0.02);
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 191, 0, 0.1);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:last-child td:first-child {
    border-radius: 0 0 0 15px;
}

tbody tr:last-child td:last-child {
    border-radius: 0 0 15px 0;
}

/* Ikona piva v řádku tabulky */
.beer-icon {
    text-align: center;
    font-size: 1.8rem;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

tbody tr:hover .beer-icon {
    transform: rotate(15deg) scale(1.2);
}

/* Tlačítka */
.login-button, .button {
    display: inline-block;
    background: linear-gradient(135deg, #ffbf00 0%, #e6ac00 100%);
    color: #1a1a1a;
    padding: 14px 28px;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 191, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.login-button::before, .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before, .button:hover::before {
    left: 100%;
}

.login-button:hover, .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 191, 0, 0.4);
}

.button-container {
    text-align: center;
    margin-bottom: 25px;
}

/* Odkaz na statistiky */
.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.stat-link:hover .total-count-container {
    border-color: #ffbf00;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 191, 0, 0.2);
}

/* Formulářové prvky */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

label {
    font-weight: 600;
    color: #f2f2f2;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
}

input[type="date"],
input[type="text"],
textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 191, 0, 0.3);
    border-radius: 10px;
    color: #f2f2f2;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

input[type="date"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #ffbf00;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 191, 0, 0.2);
}

/* Navigační odkazy */
.nav-links {
    text-align: center;
    margin-bottom: 25px;
}

.nav-links a {
    color: #ffbf00;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Fredoka', sans-serif;
}

.nav-links a:hover {
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(255, 191, 0, 0.5);
}

/* Zprávy (úspěch / chyba) */
.success, .error {
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
    animation: slideIn 0.5s ease;
}

.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(34, 139, 58, 0.9));
    border: 1px solid rgba(40, 167, 69, 0.5);
}

.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9), rgba(183, 44, 57, 0.9));
    border: 1px solid rgba(220, 53, 69, 0.5);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Statistiky */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 35px;
}

.stat-block {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.4), rgba(20, 20, 20, 0.6));
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 191, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffbf00, #ffd700, #ffbf00);
    border-radius: 15px 15px 0 0;
}

.stat-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 191, 0, 0.15);
}

.stat-block h2 {
    margin-top: 0;
    color: #ffbf00;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    border-bottom: 2px solid rgba(255, 191, 0, 0.3);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.stat-table {
    width: 100%;
}

.stat-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 191, 0, 0.1);
}

.stat-table tr:last-child td {
    border-bottom: none;
}

.stat-table td:first-child {
    font-weight: 600;
    color: #ffbf00;
}

/* Responzivní design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 25px 20px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h1::after {
        right: -45px;
        font-size: 1.5rem;
    }
    
    .total-count-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .total-count-text p {
        font-size: 2.5rem;
    }
    
    th, td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .beer-icon {
        font-size: 1.5rem;
    }
    
    th, td {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    
    .login-button, .button {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}
/* --- STYLY PRO MOBILNÍ ZAŘÍZENÍ --- */
@media screen and (max-width: 768px) {

    body {
        padding: 5px; /* Menší okraje na mobilu */
    }

    .container {
        padding: 15px; /* Menší vnitřní okraj kontejneru */
    }

    h1 {
        font-size: 28px; /* Menší nadpis */
    }

    .total-count-container img {
        height: 50px; /* Menší obrázek piva */
    }
    .total-count-text p {
        font-size: 28px; /* Menší text počítadla */
    }

    /* Kouzlo pro responzivní tabulku - přeměna na "kartičky" */
    table {
        border: 0;
        border-radius: 0;
    }

    table thead {
        /* Skryjeme původní hlavičku, popisky přidáme k buňkám */
        display: none;
    }

    table tr {
        display: block; /* Každý řádek bude samostatný blok */
        margin-bottom: 15px;
        border-radius: 5px;
        background-color: rgba(40, 40, 40, 0.8);
        border: 1px solid #444;
    }
    
    table td {
        display: block; /* Buňky se seřadí pod sebe */
        text-align: right; /* Zarovnáme data doprava, popisky budou vlevo */
        padding-left: 50%; /* Vytvoříme místo pro popisek */
        position: relative;
        border-bottom: 1px solid #555;
    }
    
    table td:last-child {
        border-bottom: 0;
    }

    /* Pomocí ::before pseudo-elementu vložíme popisek z data-label atributu */
    table td::before {
        content: attr(data-label); /* Vezme text z atributu data-label="" */
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
        color: #ffbf00; /* Zlatavá barva pro popisky */
    }

    /* Speciální úpravy pro ikonu piva a záznam */
    .beer-icon {
        display: none; /* Na mobilu ikonu skryjeme, šetří místo */
    }

    /* U buňky se záznamem chceme jiné zarovnání */
    td[data-label="Záznam:"] {
        text-align: left;
        padding-left: 15px;
    }
    td[data-label="Záznam:"]::before {
        /* Zobrazíme popisek nad textem, ne vedle něj */
        position: static;
        display: block;
        margin-bottom: 5px;
        width: auto;
    }
}