/* --- 1. OSNOVE & SPREMENLJIVKE --- */
:root { 
    --bg: #050505; 
    --ui: #111; 
    --accent: #fff; 
    --dim: #777; 
    --border: #222; 
    --success: #00ff00;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background: var(--bg); 
    color: #fff; 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
}

.hidden { display: none !important; }

/* --- 2. NAVBAR & GUMBI --- */
.navbar { 
    position: fixed; top: 0; width: 100%; padding: 25px 5%; 
    display: flex; justify-content: space-between; align-items: center; 
    z-index: 1000; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); 
}

.logo { font-weight: 900; font-size: 1.4rem; cursor: pointer; }
.logo span { font-weight: 200; opacity: 0.5; margin-left: 2px; }

.nav-btn, .back-btn { 
    background: none; border: 1px solid var(--border); color: #fff; 
    padding: 8px 18px; border-radius: 20px; cursor: pointer; 
    font-size: 11px; transition: 0.3s; 
}
.nav-btn:hover, .back-btn:hover { background: #fff; color: #000; }

/* --- 3. MREŽE (ALBUMI & SLIKE) --- */
.container { max-width: 1600px; margin: 0 auto; padding: 120px 5% 50px; }

.album-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); 
    gap: 30px; 
}

.album-card { 
    position: relative; aspect-ratio: 3/2; cursor: pointer; 
    overflow: hidden; background: #000; 
}
.album-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.8s; opacity: 0.7; }
.album-card:hover img { transform: scale(1.04); opacity: 1; }
.album-card .meta { position: absolute; bottom: 30px; left: 30px; }

/* --- 4. VIEW MODES (TOČKA 2 & 4) --- */
.photo-grid.square-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.photo-grid.square-mode .photo-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.photo-grid.square-mode img {
    height: 100%; width: 100%; object-fit: cover;
}

/* Natural Mode - Preprečevanje raztegovanja */
.photo-grid.natural-mode {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.photo-grid.natural-mode .photo-item {
    flex-grow: 1; height: 350px;
    background: #080808;
}
.photo-grid.natural-mode img {
    height: 100%; width: auto; 
    max-width: 100%;
    object-fit: contain; /* TOČKA 2: Ne raztegne slike */
}

.photo-item { cursor: pointer; transition: transform 0.3s; }
.photo-item img { display: block; filter: blur(20px); transition: 0.8s ease; opacity: 0; }
.photo-item img.loaded { filter: blur(0); opacity: 1; }

/* --- 5. IKONE & KONTROLE --- */
.view-controls-wrapper { 
    display: flex; justify-content: space-between; align-items: flex-end; 
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #111; 
}

.icon-btns { display: flex; gap: 10px; align-items: center; }

.zoom-tools button, .icon-btns button {
    background: none; border: none; padding: 5px;
    display: flex; align-items: center; justify-content: center;
    width: 35px; height: 35px; cursor: pointer;
}

.zoom-tools svg, .icon-btns svg {
    width: 20px; height: 20px; fill: #fff; opacity: 0.4; transition: 0.3s;
}
.zoom-tools button:hover svg, .icon-btns button:hover svg { opacity: 1; }

/* Slideshow Active State (TOČKA 3) */
.icon-btns button.active svg { fill: var(--success); opacity: 1; }

.share-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; }
#copy-msg { position: absolute; top: -30px; font-size: 10px; color: #fff; opacity: 0; transition: 0.3s; }
#copy-msg.show { opacity: 1; transform: translateY(-5px); }

/* --- 6. LIGHTBOX & ZOOM (TOČKA 4, 5, 6) --- */
#zoom-overlay { 
    position: fixed; inset: 0; background: #000; 
    z-index: 9000; display: flex; flex-direction: column; 
}

#zoom-stage { 
    flex: 1; display: flex; align-items: center; justify-content: center; 
    position: relative; overflow: hidden; 
}

/* TOČKA 6: Natural Panning setup */
#zoom-img { 
    max-height: 85vh; max-width: 95vw; 
    transition: transform 0.3s cubic-bezier(0.1, 0, 0.2, 1); 
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

#zoom-img.zoomed { 
    transform: scale(2.5); 
    cursor: grab; 
}

#zoom-img.zoomed:active {
    cursor: grabbing;
}

#filmstrip-container { 
    height: 100px; background: #050505; position: relative; 
    overflow: hidden; border-top: 1px solid #111; width: 100%;
}
#filmstrip-track { 
    display: flex; gap: 10px; padding: 10px; 
    position: absolute; left: 50%;
    transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1); 
}
.film-thumb { height: 80px; width: auto; opacity: 0.3; cursor: pointer; border: 2px solid transparent; transition: 0.3s; }
.film-thumb.active { opacity: 1; border-color: #fff; }

.zoom-top { display: flex; justify-content: space-between; padding: 20px 40px; align-items: center; }
.nav-arrow { position: absolute; background: none; border: none; color: #fff; font-size: 3rem; padding: 40px; cursor: pointer; opacity: 0.1; transition: 0.3s; z-index: 100; top: 50%; transform: translateY(-50%); }
.nav-arrow:hover { opacity: 1; }
.prev { left: 0; } .next { right: 0; }

/* --- 7. ADMIN & MODALI (TOČKA 1, 8) --- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 5000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-card { background: var(--ui); border: 1px solid var(--border); padding: 40px; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; }

input, textarea {
    width: 100%; background: #000; border: 1px solid var(--border); color: #fff; padding: 12px; margin-bottom: 12px; font-family: inherit; font-size: 14px;
}

.btn-primary { background: #fff; color: #000; border: none; padding: 15px; font-weight: 900; text-transform: uppercase; width: 100%; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.btn-primary:hover { opacity: 0.8; }
.btn-minimal { background: transparent; color: var(--dim); border: 1px solid var(--border); padding: 10px; width: 100%; cursor: pointer; margin-top: 10px; font-size: 11px; }

/* TOČKA 1: Drag and Drop & Preview UI */
.drop-zone { 
    border: 2px dashed var(--border); padding: 40px; text-align: center; 
    color: var(--dim); cursor: pointer; font-size: 12px; margin: 10px 0;
    transition: 0.3s;
}
.drop-zone.drag-over { border-color: var(--accent); background: rgba(255,255,255,0.05); }

.admin-photos-preview { 
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; 
    margin-top: 20px; padding: 10px; background: #000;
}
.admin-photo-card { position: relative; aspect-ratio: 1/1; border: 2px solid transparent; overflow: hidden; }
.admin-photo-card img { width: 100%; height: 100%; object-fit: cover; }
.admin-photo-card.is-cover { border-color: var(--success); }

.btn-del-img { 
    position: absolute; top: 2px; right: 2px; background: rgba(255,0,0,0.9); 
    color: white; border: none; border-radius: 50%; width: 22px; height: 22px; 
    cursor: pointer; font-size: 12px; font-weight: bold;
}

.cover-badge {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: var(--success); color: #000;
    font-size: 9px; font-weight: 900; text-align: center;
    padding: 3px 0; display: none; text-transform: uppercase;
}
.admin-photo-card.is-cover .cover-badge { display: block; }

/* Custom Checkbox (TOČKA 8) */
.custom-checkbox { display: flex; align-items: center; cursor: pointer; font-size: 13px; color: var(--dim); margin: 15px 0; }
.custom-checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkmark { height: 18px; width: 18px; background: #000; border: 1px solid var(--border); margin-right: 12px; position: relative; }
.custom-checkbox input:checked ~ .checkmark { background: #fff; border-color: #fff; }
.checkmark:after { content: ""; position: absolute; display: none; left: 6px; top: 2px; width: 4px; height: 8px; border: solid black; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.custom-checkbox input:checked ~ .checkmark:after { display: block; }

/* --- 8. KONTAKT (TOČKA 5) --- */
#contact-view { text-align: center; max-width: 600px; margin: 150px auto; padding: 20px; }
#contact-view h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; letter-spacing: -2px; }
#contact-feedback { 
    margin-top: 15px; padding: 15px; border-radius: 4px; 
    font-size: 13px; font-weight: bold; display: none;
}
#contact-feedback.success { background: rgba(0, 255, 0, 0.1); color: var(--success); display: block; }
#contact-feedback.error { background: rgba(255, 0, 0, 0.1); color: #ff4444; display: block; }

/* Mobile Optimization */
@media (max-width: 768px) {
    .album-grid { grid-template-columns: 1fr; }
    .zoom-top { padding: 20px; }
    .nav-arrow { font-size: 2rem; padding: 20px; }
}