:root {
    --bg-color: #0a0a0a;
    --text-main: #f5f5f5;
    --text-muted: #888888;
    --accent-gold: #d4af37;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    /* ZMIANA: Tło musi być przezroczyste, inaczej czarny kolor zasłoni film! */
    background-color: var(--bg-color, #0a0a0a) !important;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

body.no-scroll { overflow: hidden; }

.container { width: 100%; max-width: 1200px; text-align: center; }

/* ==========================================
   PRZYCISK POWROTU (POPRAWIONY)
   ========================================== */
.btn-back {
    position: fixed; /* Niezmiennie trzyma się ekranu przy scrollowaniu */
    top: 15px;       /* Przyklejony blisko góry */
    left: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    /* KLUCZOWE: Czarne tło, aby nie prześwitywały przez niego zdjęcia przy scrollowaniu! */
    background-color: var(--bg-color, #0a0a0a); 
    
    border: 1px solid var(--accent-gold, #d4af37);
    color: var(--accent-gold, #d4af37); 
    font-family: var(--font-body);
    text-transform: uppercase; 
    letter-spacing: 2px; 
    font-size: 0.8rem;
    padding: 12px 25px; 
    cursor: pointer; 
    transition: all 0.4s ease;
    text-decoration: none;
    
    /* KLUCZOWE: Mniejszy z-index (1000). Lightbox ma 2500, więc guzik powrotu 
       zniknie z ekranu, gdy klient otworzy powiększone zdjęcie! */
    z-index: 1000; 
}

.btn-back:hover { 
    background-color: var(--accent-gold, #d4af37); 
    color: #000; 
}

.btn-back svg {
    width: 18px;
    height: 18px;
    transition: transform 0.4s ease;
}

.btn-back:hover svg {
    transform: translateX(-5px);
}

/* ==========================================
   RESZTA STYLÓW GALERII
   ========================================== */
.error-msg-js {
    position: fixed; top: 20px; right: 20px;
    background: #ff4c4c; color: white;
    padding: 15px 25px; border-radius: 4px;
    z-index: 3000; animation: fadeIn 0.4s ease;
}

.brand-header { margin-bottom: 4rem; }
.brand-header h1 { font-family: var(--font-heading); font-size: 2.5rem; letter-spacing: 4px; text-transform: uppercase; font-weight: 400; }
.brand-header .subtitle { font-size: 0.8rem; letter-spacing: 8px; color: var(--accent-gold); margin-top: 0.5rem; }

.login-section { max-width: 400px; margin: 0 auto; animation: fadeIn 1s ease-in-out; }
.login-section h2 { font-family: var(--font-heading); font-size: 2rem; font-weight: 400; margin-bottom: 1rem; }
.login-section p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 2rem; }

.input-group input {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px solid #333; color: var(--text-main);
    font-family: var(--font-body); font-size: 1rem; padding: 10px 0;
    text-align: center; transition: all 0.3s ease; letter-spacing: 2px;
}
.input-group input:focus { outline: none; border-bottom-color: var(--accent-gold); }

/* GŁÓWNY PRZYCISK (Dla porównania - styl ten sam co btn-back) */
.btn-primary {
    background-color: transparent; border: 1px solid var(--accent-gold);
    color: var(--accent-gold); font-family: var(--font-body);
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem;
    padding: 15px 40px; margin-top: 2rem; cursor: pointer; transition: all 0.4s ease;
}
.btn-primary:hover { background-color: var(--accent-gold); color: var(--bg-color); }
.error-message { color: #ff4c4c; font-size: 0.85rem; margin-top: 1rem; min-height: 20px; }

.hidden { display: none !important; }
.gallery-section { animation: fadeIn 1s ease-in-out; }
#galleryTitle { font-family: var(--font-heading); font-size: 3rem; margin-bottom: 1.5rem; color: var(--accent-gold); letter-spacing: 1px; }

.gallery-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #222;
}
.toolbar-stats { font-size: 1rem; letter-spacing: 1px; }
.btn-small { padding: 12px 25px; font-size: 0.75rem; margin-top: 0; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.gallery-grid img {
    width: 100%; height: 400px; object-fit: cover;
    border-radius: 4px; transition: transform 0.5s ease, filter 0.5s ease;
    filter: grayscale(20%); cursor: pointer;
}
.gallery-grid img:hover { transform: scale(1.02); filter: grayscale(0%); }

.mobile-only { display: none; }
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center;
    z-index: 2000; backdrop-filter: blur(10px);
}
.modal-content { background: #111; border: 1px solid #222; max-width: 800px; width: 90%; display: flex; animation: fadeIn 0.6s ease; }
.modal-photo { flex: 1; min-width: 300px; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-text { flex: 1.2; padding: 40px; text-align: left; display: flex; flex-direction: column; justify-content: center; }
.modal-text h3 { font-family: var(--font-heading); color: var(--accent-gold); font-size: 2rem; margin-bottom: 15px; }
.modal-text p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

.social-links { margin: 25px 0; display: flex; flex-wrap: wrap; gap: 15px; }
.social-links a { color: var(--text-main); text-decoration: none; font-size: 0.8rem; letter-spacing: 1px; border-bottom: 1px solid var(--accent-gold); padding-bottom: 2px; transition: 0.3s; }
.social-links a.review-link { display: block; width: 100%; color: var(--accent-gold); font-weight: 600; border: none; }

.modal-footer { margin-top: auto; padding-top: 20px; }
.checkbox-container { display: block; position: relative; padding-left: 30px; margin-bottom: 20px; cursor: pointer; font-size: 0.8rem; color: var(--text-muted); }
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; }
.checkmark { position: absolute; top: 0; left: 0; height: 18px; width: 18px; background-color: transparent; border: 1px solid var(--accent-gold); }
.checkbox-container input:checked ~ .checkmark:after { content: "✓"; position: absolute; color: var(--accent-gold); left: 3px; top: -2px; }

.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(10, 10, 10, 0.98); display: flex;
    flex-direction: column; justify-content: center; align-items: center;
    z-index: 2500; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.lightbox.active { opacity: 1; pointer-events: auto; backdrop-filter: blur(5px); }

.lightbox-top-bar { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; width: 40%; z-index: 50; }
#lightboxCounter { color: var(--text-main); font-size: 0.9rem; letter-spacing: 3px; margin-bottom: 8px; font-weight: 600; }
.lightbox-slider { width: 100%; cursor: pointer; accent-color: var(--accent-gold); opacity: 0.7; transition: opacity 0.3s; }
.lightbox-slider:hover { opacity: 1; }

.loader-spinner {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold); border-radius: 50%;
    animation: spin 1s linear infinite; display: none; z-index: 5;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.lightbox img { 
    max-width: 85vw; max-height: 75vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,0.8); 
    z-index: 10; user-select: none; transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0; 
}

.close-btn { position: absolute; top: 30px; right: 40px; color: var(--text-muted); font-size: 3rem; cursor: pointer; transition: color 0.3s ease; line-height: 1; z-index: 20; }
.close-btn:hover { color: var(--accent-gold); }

.download-icon-btn, .rotate-icon-btn { position: absolute; top: 30px; color: var(--text-muted); transition: all 0.3s ease; z-index: 20; padding: 10px; cursor: pointer; text-decoration: none; }
.download-icon-btn svg, .rotate-icon-btn svg { width: 26px; height: 26px; stroke-width: 1.5; }
.download-icon-btn:hover, .rotate-icon-btn:hover { color: var(--accent-gold); transform: translateY(-2px); }

.download-icon-btn { left: 40px; }
.rotate-icon-btn { left: 90px; }

.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.4); font-size: 3rem; cursor: pointer; user-select: none; transition: 0.3s; z-index: 15; padding: 20px; }
.nav-arrow:hover { color: white; }
.prev-arrow { left: 30px; }
.next-arrow { right: 30px; }

.nav-zone { position: absolute; top: 0; height: 100%; width: 30%; z-index: 12; cursor: pointer; }
.nav-zone-left { left: 0; }
.nav-zone-right { right: 0; }

/* RESPONSYWNOŚĆ */
@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
    .gallery-grid img { height: 250px; }
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .desktop-only { display: none; }
    .mobile-only { display: block; }
    
    /* Zmniejszenie i dopasowanie guzika powrotu na telefonach */
    .btn-back {
        top: 10px; /* Na samej górze ekranu */
        left: 10px;
        padding: 10px 15px;
        font-size: 0.65rem;
    }
    .btn-back svg { width: 16px; height: 16px; }

    /* Opuszczenie napisu powitalnego w dół, żeby nie nachodził na niego guzik powrotu na telefonie */
    .brand-header { margin-bottom: 2.5rem; margin-top: 5rem; }
    
    .brand-header h1 { font-size: 1.8rem; letter-spacing: 2px; }
    .login-section h2 { font-size: 1.5rem; }
    #galleryTitle { font-size: 2rem; margin-bottom: 2rem; }

    .gallery-toolbar { flex-direction: column; gap: 15px; }
    .btn-primary { width: 100%; padding: 15px 20px; box-sizing: border-box; }

    .modal-content { flex-direction: column; max-height: 90vh; overflow-y: auto; width: 95%; }
    .modal-photo { min-height: 200px; flex: none; }
    .modal-text { padding: 25px 20px; text-align: center; }
    .modal-text h3 { font-size: 1.8rem; }
    .social-links { justify-content: center; }

    .lightbox-top-bar { width: 60%; top: 20px; }
    .lightbox img { max-width: 100vw; max-height: 65vh; margin-top: 20px; }
    .close-btn { top: 15px; right: 20px; font-size: 2.5rem; }
    
    .download-icon-btn { top: 15px; left: 20px; padding: 5px; }
    .rotate-icon-btn { top: 15px; left: 60px; padding: 5px; }
    .download-icon-btn svg, .rotate-icon-btn svg { width: 22px; height: 22px; }

    .nav-arrow { display: none; }
    .nav-zone { width: 40%; }
}

/* ==========================================
   TŁO WIDEO (STREFA KLIENTA)
   ========================================== */
.strefa-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -999; /* Gwarantuje, że film będzie pod formularzem logowania */
    overflow: hidden;
    background-color: var(--bg-color); /* Awaryjne tło, zanim film się załaduje */
}

.strefa-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Wypełnia cały ekran bez zniekształceń */
    opacity: 0.25; /* Mocne przyciemnienie filmu, żeby logowanie było wyraźne */
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================
   ZAKŁADKI I FILMY (FOTO/WIDEO)
   ========================================== */
.gallery-tabs {
    display: flex; justify-content: center; gap: 20px; margin-bottom: 30px;
}
.tab-btn {
    background: transparent; border: 1px solid #333; color: var(--text-muted);
    padding: 10px 30px; font-family: var(--font-body); font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 2px; cursor: pointer;
    transition: all 0.3s ease; border-radius: 4px; outline: none;
}
.tab-btn:hover { color: var(--text-main); border-color: var(--accent-gold); }
.tab-btn.active {
    background: rgba(212, 175, 55, 0.1); border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.gallery-grid video {
    width: 100%; height: 400px; object-fit: cover;
    border-radius: 4px; background: #000; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

@media (max-width: 900px) {
    .gallery-grid video { height: 250px; }
}