/* Schriftarten */
/*Schriftart 1 einbinden aus Ordner font*/
@font-face {
  font-family: headlineFontCurved;
  src: url(font/Bellarina.otf);
}

/*Schriftart 2 einbinden aus Ordner font*/
@font-face {
  font-family: headlineFontStraight;
  src: url(font/Gemola-wooyn.ttf);
}

/*Schriftart 3 einbinden aus Ordner font*/
@font-face {
  font-family: mainFont;
  src: url(font/Calibrilight.ttf);
  font-weight: 300; /* LIGHT */
}

/*Schriftart 4 einbinden aus Ordner font*/
@font-face {
  font-family: mainFont;
  src: url(font/Calibri.ttf);
  font-weight: 400; /* REGULAR */
}

/*Schriftart 5 einbinden aus Ordner font*/
@font-face {
  font-family: mainFont;
  src: url(font/Calibribold.ttf);
  font-weight: 700; /* BOLD */
}

/*Schriftart 6 einbinden aus Ordner font*/
@font-face {
  font-family: backupFont;
  src: url(font/calibril.ttf);
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    font-family: mainFont, backupFont, Calibri;
    background-color: rgba(250, 245, 234, 1);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5000;

    background-color: rgba(250, 245, 234, 0.8); /* 🔥 NEU */
    backdrop-filter: blur(6px); /* optional nice effect */

    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    margin: 12px;
    font-size: 26px;
    font-family: headlineFontStraight;
    font-weight: 400;
    display: flex;
    justify-content: center;
    align-items: center;
}

main {
    padding-top: 108px;
}

/* ==========================
   TOP CONTROL BAR
   ========================== */

.top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 12px 12px 12px; /* mehr oben */
}

.upload-section,
.selection-controls {
    display: flex;
    align-items: center;
}

.upload-section {
    flex: 1;
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 12px; /* Abstand zwischen Auswahl & Download */
}

/* ==========================
   BUTTON BASIS
   ========================== */

.top-controls button {
    appearance: none;
    background-color: rgba(250, 245, 234, 1);
    color: black;

    border-radius: 10px;
    border: none;

    box-shadow:
        rgba(0, 0, 0, 0.2) 0 3px 5px -1px,
        rgba(0, 0, 0, 0.14) 0 6px 10px 0,
        rgba(0, 0, 0, 0.12) 0 1px 18px 0;

    box-sizing: border-box;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 400;

    height: 42px;
    padding: 0 16px;

    letter-spacing: 0.25px;

    transition:
        box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 270ms cubic-bezier(0, 0, 0.2, 1),
        background 0.2s ease,
        color 0.2s ease;

    user-select: none;
    -webkit-user-select: none;

    will-change: transform, opacity;
}

/* Hover nur für Desktop */
@media (hover: hover) {
    .top-controls button:hover {
        background: white;
        color: #174ea6;
        transform: translateY(-1px);
    }
}

/* Upload Button */
#custom-upload-btn {
}

/* Auswahl Button */
#toggle-select-mode {
}

#toggle-select-mode.active {
    background: #2196f3;
}

/* Download Icon Button */
#download-selected {
    width: 42px;
    height: 42px;
    padding: 0;
    position: relative;
    flex: 0 0 42px;
}

#download-count {
    position: absolute;
    top: -5px;
    right: -5px;

    background: #2196f3;
    color: #fff;

    font-size: 11px;
    font-weight: bold;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
}

@media (max-width: 768px) {

    #download-count {
        top: -4px;
        right: -4px;

        width: 16px;
        height: 16px;

        font-size: 10px;
    }

}

/* Verstecken */
.hidden {
    display: none !important;
}

/* ==========================
   AUSWAHLMODUS
   ========================== */

.gallery-item.selected::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 4px solid #2196f3;
    box-sizing: border-box;
    pointer-events: none;
}

/* ==========================
   GALLERY GRID
   ========================== */

.gallery {
    display: grid;
    gap: 4px;
    padding: 4px;
}

/* 📱 Handy → 4 Bilder */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 💻 Desktop → 10 Bilder */
@media (min-width: 769px) {
    .gallery {
        grid-template-columns: repeat(10, 1fr);
    }
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================
   OVERLAY FULLSCREEN
   ========================== */

#overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;

    overscroll-behavior: none;
    touch-action: none;
}

/* WICHTIG: Video darf Touch-Events bekommen */
.slide video {
    pointer-events: auto;
    z-index: 10000;
}

/* Overlay darf Touch nicht blockieren */
.slide {
    pointer-events: none;
}

.slide img {
    pointer-events: auto;
}

#overlay.active {
    display: flex;
}

/* ==========================
   SLIDER
   ========================== */

.slider {
    display: flex;
    width: 300%;
    height: 100%;
    will-change: transform;
}

.slide {
    width: 100%;
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;

    display: flex;
    justify-content: center;
    align-items: center;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.2s ease;
}

/* ==========================
   VERSION BOX
   ========================== */

#version-box {
    display: none;
    
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    
    background: red;
    color: white;
    
    padding: 6px 12px;
    border-radius: 20px;
    
    font-size: 12px;
    z-index: 9999;
}



.video-item {
    position: relative;
    cursor: pointer;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    text-shadow: 0 0 15px black;
    pointer-events: none;
}

.gallery-item video {
    object-fit: cover;
}


/* ==========================
   UPLOAD PROGRESS OVERLAY
   ========================== */

#upload-progress-overlay {
    position: fixed;
    inset: 0;

    background: rgba(250, 245, 234, 0.5); /* dein Beige */
    backdrop-filter: blur(6px);

    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.upload-box {
    width: 90%;
    max-width: 420px;

    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);

    padding: 28px;
    border-radius: 18px;

    text-align: center;
    color: #2b2b2b;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.12),
        0 1px 0 rgba(255,255,255,0.6) inset;

    border: 1px solid rgba(255,255,255,0.4);
}

#upload-text {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.4;
    font-family: mainFont, Calibri;
    color: #3a3a3a;
}

.progress-bar {
    width: 100%;
    height: 12px;

    background: rgba(0,0,0,0.08);
    border-radius: 999px;

    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;

    background: linear-gradient(90deg, #c7b299, #a58a6a);

    transition: width 0.25s ease;
    border-radius: 999px;
}

/* Upload Status Farben */

.upload-success {
    color: #2f6f4e;
    font-weight: 600;
}

.upload-error {
    color: #b04a4a;
    font-weight: 600;
}


/* ==========================
   DESKTOP OVERLAY CONTROLS
   ========================== */

.overlay-nav,
#overlay-close {
    position: absolute;
    border: none;
    background: rgba(0,0,0,0.35);
    color: white;
    font-size: 28px;
    cursor: pointer;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(4px);

    transition: all 0.2s ease;
    z-index: 20000;
}

/* Hover nur Desktop */
@media (hover: hover) {
    .overlay-nav:hover,
    #overlay-close:hover {
        background: rgba(0,0,0,0.55);
        transform: scale(1.08);
    }
}

/* Positionen */

#overlay-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#overlay-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#overlay-close {
    top: 20px;
    right: 20px;
    font-size: 22px;
}

/* 📱 Auf Mobile komplett verstecken */

@media (max-width: 768px) {

    .overlay-nav,
    #overlay-close {
        display: none;
    }

}

.download-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
}

/* ==========================
   BUTTON BREITEN (NEU)
   ========================== */

/* 📱 Mobile */
@media (max-width: 768px) {

    #custom-upload-btn,
    #toggle-select-mode {
        width: 25vw;
        min-width: 120px;
    }

}

/* 💻 Desktop */
@media (min-width: 769px) {

    #custom-upload-btn,
    #toggle-select-mode {
        width: 15vw;
        min-width: 160px;
    }

}

.back-to-site-btn {
    width: 240px;
    
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);

    /* exakt dein Button-Style */
    appearance: none;
    background-color: rgba(250, 245, 234, 1);
    color: black;

    border-radius: 10px;
    border: none;

    box-shadow:
        rgba(0, 0, 0, 0.2) 0 3px 5px -1px,
        rgba(0, 0, 0, 0.14) 0 6px 10px 0,
        rgba(0, 0, 0, 0.12) 0 1px 18px 0;

    box-sizing: border-box;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 400;

    height: 42px;
    padding: 0 16px;

    letter-spacing: 0.25px;

    transition:
        box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 270ms cubic-bezier(0, 0, 0.2, 1),
        background 0.2s ease,
        color 0.2s ease;

    user-select: none;
    -webkit-user-select: none;

    will-change: transform, opacity;

    z-index: 99999;
}

@media (hover: hover) {
    .back-to-site-btn:hover {
        background: white;
        color: #174ea6;
        transform: translateX(-50%) translateY(-1px);
    }
}

/* Button ausblenden wenn Overlay aktiv ist */
.back-to-site-btn.hidden-by-overlay {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.25s ease;
}