/* gallery.css */

:root {
    /* Kolory */
    --primary-color: #5C4033; /* Ciemny brąz (nawiązanie do drewna) */
    --secondary-color: #FFD700; /* Żółty (złoty) jako akcent */
    --background-color: #f4f4f4; /* Tło strony */
    --text-color: #333; /* Kolor tekstu */
    --light-text-color: #ecf0f1; /* Jasny tekst na ciemnym tle */
    --footer-bg-color: #4B3621; /* Ciemny brąz dla stopki */
    --header-bg-color: #5C4033; /* Ciemny brąz dla nagłówka */
    --cta-bg-color: #FFD700; /* Żółty tło dla sekcji CTA */

    /* Typografia */
    --font-family: 'Roboto', sans-serif;
    --font-size-small: 14px;
    --font-size-medium: 16px;
    --font-size-large: 20px;

    /* Odstępy */
    --spacing-small: 8px;
    --spacing-medium: 16px;
    --spacing-large: 24px;

    /* Inne */
    --border-radius: 8px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* Animacje */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* Reset domyślnych stylów przeglądarki */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
}

#menu-toggle {
    display: none;
}


/* Sekcje projektów */
.project-section {
    background: linear-gradient(to bottom, #fff, #f9f9f9);
    border-radius: var(--border-radius);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing-large);
    padding: var(--spacing-large);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-medium);
    text-align: center;
    position: relative;
    padding-bottom: var(--spacing-small);
}
.project-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 3.125rem;
    height: 0.25rem;
    background-color: var(--secondary-color);
    transform: translateX(-50%);
}

.project-section p {
    font-size: var(--font-size-medium);
    line-height: 1.6;
    color: #666;
    text-align: center;
    margin-bottom: var(--spacing-medium);
}

/* Galeria */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Odstęp między miniaturkami */
    align-items: center;
    justify-content: center;
}

.gallery-item {
  position: relative;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 0.375rem 0.75rem rgba(0, 0, 0, 0.2);
}

.gallery-item .thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  opacity: 0; /* Obrazek na początku jest przezroczysty */
  transition: opacity 0.4s ease-in-out; /* Animacja pojawiania się */
}

/* Opis galerii */
#caption {
  position: absolute;
  bottom: var(--spacing-small);
  left: var(--spacing-small);
  color: white;
  font-size: 1.125rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.625rem;
  border-radius: var(--border-radius);
  display: none;
}

/* Scroll to top */
.scroll-to-top {
    position: fixed;
    bottom: var(--spacing-large);
    right: var(--spacing-large);
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
    transform: scale(0);
}
.scroll-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}
.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
.scroll-to-top:hover {
    background-color: rgba(255, 204, 0, 0.8);
}

/* Suwak miniatur */
.slider-container {
    margin: var(--spacing-medium);
    text-align: center;
    position: sticky;
    top: var(--spacing-medium);
    right: var(--spacing-medium);
    background: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-small);
    border-radius: var(--border-radius);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: opacity 0.3s ease;
  
    align-items: center;    /* wyśrodkowanie pionowe */
    gap: 10px;              /* odstęp między etykietą a suwakiem */
}
.slider-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modal */
#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
}
/* Modal - Active */
.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius);
    object-fit: contain;
    margin: auto;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content.fade-out {
    opacity: 0;
}

/* Nowy styl przycisków modalu */
.close,
.prev,
.next {
  color: #fff;
  cursor: pointer;
  position: absolute;
  background: rgba(50, 50, 50, 0.8);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background 0.3s ease;
}

/* Przycisk zamykania */
.close {
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
}

/* Nawigacja: poprzedni i następny */
.prev,
.next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}

.prev {
  left: 2rem;
}

.next {
  right: 2rem;
}

/* Licznik */
.counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: #fff;
  font-size: 1rem;
  background: rgba(50, 50, 50, 0.8);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Efekt hover */
.close:hover,
.prev:hover,
.next:hover {
  background: var(--secondary-color);
}


/* Dodatkowy krótki opis strony */
.short-description {
    background-color: var(--background-color);
    padding: var(--spacing-medium);
    margin-bottom: var(--spacing-large);
    text-align: center;
    font-size: var(--font-size-medium);
    color: var(--text-color);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    margin-top: var(--spacing-large);
    margin-left: auto;
    margin-right: auto;
}
.short-description p {
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
/* Projekty i Galeria */
    .project-section h2 {
      font-size: 1.5rem;
    }
    .project-section p {
      font-size: var(--font-size-small);
    }
    .gallery {
      grid-template-columns: 1fr;
    }
    .gallery-item {
      margin-bottom: var(--spacing-medium);
    }
    #caption {
      font-size: 1rem;
    }
    .scroll-to-top {
      width: 2.5rem;
      height: 2.5rem;
      font-size: 1.25rem;
    }
    .slider-container {
      padding: var(--spacing-small);
    }
    .close,
    .prev,
    .next {
      font-size: 1.5rem;
      width: 2rem;
      height: 2rem;
    }
    .counter {
      font-size: 1rem;
      padding: 0.25rem 0.5rem;
    }
  
}

  
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: opacity 0.5s ease-out;
  }
  
  #progress-bar {
    width: 80%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
  }
  
  #progress-fill {
    width: 0%;
    height: 100%;
    background: #4caf50;
    transition: width 0.2s;
  }
  
  .hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  .project-description-box {
  max-width: 800px; /* Ogranicza maksymalną szerokość opisu */
  margin: 15px auto; /* Centruje ramkę i dodaje odstęp góra/dół */
  padding: 20px; /* Wewnętrzny odstęp w ramce */
  border: 1px solid #ddd; /* Delikatna, szara ramka */
  border-radius: 8px; /* Zaokrąglone rogi */
  background-color: #f9f9f9; /* Bardzo jasne tło dla odróżnienia */
  line-height: 1.6; /* Poprawia czytelność tekstu */
  text-align: center; /* Wyśrodkowanie tekstu w ramce */
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 4px solid #e0e0e0; /* Bardziej widoczny szary */
  border-top: 4px solid var(--primary-color); /* Użycie koloru głównego motywu */
  border-radius: 50%;
  animation: spin 1.2s linear infinite; /* Nieco szybsza animacja */
  z-index: 1;
  will-change: transform; /* Optymalizacja animacji */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Base Navigation Styles --- */
.project-nav-container {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-medium);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 998;
    position: relative;
}

#toggle-nav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.project-nav-container.nav-hidden #project-nav-list {
    display: none;
}

.project-nav-container h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-small);
    padding-bottom: var(--spacing-small);
    border-bottom: 2px solid var(--secondary-color);
    font-size: 1.1rem;
    text-align: center;
}

#project-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#project-nav-list li a {
    display: block;
    padding: var(--spacing-small);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
    word-wrap: break-word;
}

#project-nav-list li a:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

#mobile-nav-toggle {
    display: none; /* Hidden by default */
}

.close-nav-btn {
    display: none; /* Hidden by default */
}



/* --- Desktop Navigation Styles (> 1200px) --- */
@media (min-width: 1201px) {
    .project-nav-container {
        position: fixed;
        top: 110px;
        right: 20px;
        width: 220px;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        transform: translateX(110%);
    }

    .project-nav-container.visible {
        opacity: 1;
        transform: translateX(0);
    }
}


/* --- Mobile Navigation Styles (<= 1200px) --- */
@media (max-width: 1200px) {
    #toggle-nav-btn {
        display: none; /* Hide desktop toggle button */
    }

    #mobile-nav-toggle {
        display: block; /* Show mobile button */
        position: fixed;
        bottom: 20px;
        left: 20px;
        background-color: rgba(92, 64, 51, 0.8);
        color: var(--secondary-color);
        padding: var(--spacing-small);
        border: 1px solid var(--secondary-color);
        border-radius: var(--border-radius);
        font-size: var(--font-size-medium);
        text-align: center;
        cursor: pointer;
        z-index: 1100;
        opacity: 0.8;
        transition: background-color 0.3s ease, opacity 0.3s ease;
    }

    #mobile-nav-toggle.active {
        background-color: var(--primary-color);
        opacity: 1;
    }

    .project-nav-container {
        position: fixed;
        bottom: 80px;
        left: 20px;
        width: fit-content;
        min-width: 180px;
        max-width: calc(100vw - 40px);
        margin: 0;
        padding: var(--spacing-small);
        background-color: rgba(255, 255, 255, 0.95);
        border: 1px solid #ccc;
        border-radius: var(--border-radius);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: none; /* Hidden by default */
        height: auto;
        max-height: 60vh;
        overflow-y: auto;
    }

    .project-nav-container.mobile-nav-open {
       display: block;
    }

    .project-nav-container h3 {
        font-size: 1.2rem;
        color: var(--primary-color);
    }

    #project-nav-list li a {
        color: var(--primary-color);
        font-size: 1rem;
        padding: var(--spacing-small);
    }

    .close-nav-btn {
        display: none; /* Hide the 'x' close button, not needed for this style */
    }
}

#gallery {
  overflow: auto; /* Zapobiega "opływaniu" nawigacji przez galerię */
}
