body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    text-align: center;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

h1 {
    color: #d4a373;
    margin-bottom: 10px;
}

.alert {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.success { background-color: #d4edda; color: #155724; }
.error { background-color: #f8d7da; color: #721c24; }

/* Stylování nahrávacího tlačítka */
.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    margin-bottom: 20px;
}

.btn {
    border: 2px dashed #d4a373;
    color: #d4a373;
    background-color: white;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.btn-submit {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background-color: #d4a373;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-submit:hover {
    background-color: #c08d5d;
}

.nav-link {
    display: inline-block;
    margin-top: 25px;
    color: #555;
    text-decoration: none;
    font-weight: bold;
}

/* Mřížka pro galerii */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.gallery-item img:hover {
    transform: scale(1.03);
}

/* Styly pro kontejner s náhledy */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
}

/* Styl pro jednotlivý náhled (obrázek + text) */
.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100px;
}

/* Samotný obrázek náhledu */
.preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid #eee;
}

/* Název souboru pod náhledem */
.preview-name {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-align: center;
    width: 100%;
    /* Zkrácení příliš dlouhého textu třemi tečkami */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LIGHTBOX STYLY */
.lightbox {
    display: none; /* Skryté ve výchozím stavu */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Zvětšený obrázek */
.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    user-select: none; /* Zabrání nechtěnému označování při swipe */
}

/* Zavírací křížek */
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.close-btn:hover {
    color: #d4a373;
}

/* Šipky pro navigaci */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
    z-index: 1001;
}

.nav-btn:hover {
    background: rgba(212, 163, 115, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* Skrytí šipek na velmi malých mobilech (zde se spoléhá na swipe) */
@media (max-width: 500px) {
    .nav-btn {
        background: transparent;
        padding: 10px;
    }
}