*{
     margin: 0;
    padding: 0;
    
}

/* css/style.css */

/* Základní styly */
body {
    font-family: Arial, sans-serif;
    font-size: 150%;
    color: rgb(255, 255, 0);
    /* ------------------- */
background-image: url(../obrazky/pozadi.avif);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: 50%;
    position: relative; 
    /* ------------------- */
    /* background-color: #f4f4f4; */
    /* color: #333; */
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Zajistí, že patička bude dole */
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* Hlavička a navigace */
header {
    /* background-color: #333; */
    color: #ffff;
    padding: 15px 0;
    /* border-bottom: 3px solid #007bff; */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: rgb(255, 255, 0);
    text-decoration: none;
    font-size: 1.8em;
    font-weight: bold;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: rgb(255, 255, 0);
    text-decoration: none;
    padding: 5px 0;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #007bff;
    font-size: 150%;
    background-color: #3232d762;
}
nav ul li a.active {
    /* color: #007bff; */
    background-color: #3232d7;
    
}

/* Hamburger menu pro mobily */
.nav-toggle {
    display: none; /* Skryje checkbox */
}

.nav-toggle-label {
    background-color: #007bff;
    color: #ffffff;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    display: none; /* Skryje hamburger na desktopu */
    font-size: 1.2em; /* Aby byl symbol větší */
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: white;
    height: 3px;
    width: 25px;
    border-radius: 3px;
    position: relative;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
    transition: all 0.3s ease-in-out;
}

.nav-toggle-label span::before {
    top: -8px;
}

.nav-toggle-label span::after {
    top: 8px;
}

/* Animace hamburger menu */
.nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
}

.nav-toggle:checked + .nav-toggle-label span::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle:checked + .nav-toggle-label span::after {
    transform: rotate(-45deg);
    top: 0;
}


/* Hlavní obsah */
main {
    flex-grow: 1; /* Zajistí, že hlavní obsah zabere dostupné místo */
    padding: 40px 0;
    /* background-color: #fff; */
    /* --------------- */
    /* background-image: url(../obrazky/pozadi.avif);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: 50%;
    position: relative;    */
    /* --------------- */
}

h1, h2 {
    color: rgb(255, 255, 0);
    margin-bottom: 20px;
    text-align: center;
}

p {
    margin-bottom: 1em;
}

/* Formuláře */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-weight: bold;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Patička */
footer {
    /* background-color: #333; */
    color: rgb(255, 255, 0);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
}

/* --- Administrátorské styly --- */
.admin-menu {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-menu h2 {
    text-align: left;
    margin-bottom: 15px;
    color: #333;
}

.admin-menu ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-menu ul li {
    margin: 0;
}

.user-management, .page-list, .page-edit-form {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.user-management h2, .page-list h2, .page-edit-form h2 {
    text-align: left;
    margin-bottom: 15px;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background-color: #007bff;
    color: white;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

table tbody tr:hover {
    background-color: #e9e9e9;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
    margin-right: 5px;
}

.btn-edit {
    background-color: #ffc107;
    color: #333;
    border-color: #ffc107;
}
.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
    border-color: #dc3545;
}
.btn-delete:hover {
    background-color: #c82333;
}

.btn-save {
    background-color: #28a745;
    border-color: #28a745;
}
.btn-save:hover {
    background-color: #218838;
}

.btn-cancel {
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-cancel:hover {
    background-color: #5a6268;
}

table input[type="text"], table select {
    width: auto;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* --- Fotogalerie styly --- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Lightbox styly */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Zabrání scrollování lightboxu */
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content-wrapper {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    z-index: 2;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    opacity: 0.5;
    text-decoration: none;
}

.lightbox-nav.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-nav.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

/* Rozdělení obrazovky pro kliknutí na šipky (vizuální indikace) */
.lightbox-content-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20%; /* Zmenšeno pro lepší interakci s obrázkem */
    height: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23fff" d="M14 4l-6 6 6 6z"/></svg>') 10 10, e-resize;
    z-index: 1;
}

.lightbox-content-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 20%; /* Zmenšeno pro lepší interakci s obrázkem */
    height: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23fff" d="M6 4l6 6-6 6z"/></svg>') 10 10, w-resize;
    z-index: 1;
}

/* Skrýt šipky, pokud uživatel chce kliknout na obrázek a nikoli na navigační plochu */
.lightbox-image {
    z-index: 2; /* Obrázek nad navigačními plochami */
    position: relative;
}

/* Změna kurzoru při najetí na kraje lightboxu */
.lightbox:hover .lightbox-nav.prev {
    opacity: 1;
}
.lightbox:hover .lightbox-nav.next {
    opacity: 1;
}


/* --- Responzivní design --- */

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo {
        margin-bottom: 15px;
    }

    nav {
        width: 100%;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        display: none;
        background-color: #444;
        padding: 10px 0;
        border-radius: 4px;
    }

    nav ul li {
        margin: 0;
        padding: 8px 0;
        border-bottom: 1px solid #555;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 10px 0;
        font-size: 1.1em;
    }

    .nav-toggle-label {
        display: flex;
        align-self: flex-end;
        order: -1;
        margin-bottom: 10px;
        background-color: transparent;
        /* border: 1px solid #007bff; */
    }

    .nav-toggle:checked ~ nav ul {
        display: flex;
    }

    /* Responzivní tabulky */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td::before {
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
    }

    /* Specifické popisky pro sloupce tabulky uživatelů */
    .user-management td:nth-of-type(1)::before { content: "ID:"; }
    .user-management td:nth-of-type(2)::before { content: "Uživatelské jméno:"; }
    .user-management td:nth-of-type(3)::before { content: "E-mail:"; } /* Nový sloupec */
    .user-management td:nth-of-type(4)::before { content: "Role:"; }
    .user-management td:nth-of-type(5)::before { content: "Registrován:"; }
    .user-management td:nth-of-type(6)::before { content: "Akce:"; } /* Upravený index */

    /* Specifické popisky pro sloupce tabulky stránek */
    .page-list td:nth-of-type(1)::before { content: "ID (Slug):"; }
    .page-list td:nth-of-type(2)::before { content: "Název:"; }
    .page-list td:nth-of-type(3)::before { content: "Vyžadovaná role:"; }
    .page-list td:nth-of-type(4)::before { content: "Akce:"; }

    .btn-small {
        display: block;
        width: calc(100% - 10px);
        margin-bottom: 5px;
        margin-right: 0;
    }

    /* Responzivní úpravy pro formuláře */
    .form-group {
        margin-bottom: 10px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }

    /* Responzivní úpravy pro galerii */
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .gallery-item img {
        height: 150px;
    }

    /* Responzivní úpravy pro lightbox */
    .lightbox-close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }

    .lightbox-nav {
        font-size: 18px;
        padding: 12px;
        margin-top: -40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1, h2 {
        font-size: 1.8em;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .gallery-item img {
        height: 120px;
    }

    .lightbox-close {
        font-size: 25px;
        top: 5px;
        right: 15px;
    }

    .lightbox-nav {
        font-size: 16px;
        padding: 10px;
        margin-top: -30px;
        background-color: rgba(0, 0, 0, 0.7);
        opacity: 1;
    }
}
