/* =========================================
   NAGŁÓWEK (HEADER)
   ========================================= */
header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/zdjecie_tlo.webp');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 60px 20px 30px;
    position: relative;
}

/* =========================================
   NAWIGACJA (NAVBAR)
   ========================================= */
.nawigacja {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(34, 49, 63, 0.98);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border-bottom: 3px solid var(--kolor-glowny);
}

.nav-links, .nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nawigacja a, .dropbtn {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95em;
    transition: background 0.3s, transform 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
}

@media (hover: hover) and (pointer: fine) {
    .nawigacja a:hover, .dropbtn:hover {
        background: var(--kolor-glowny);
        transform: translateY(-2px);
    }
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn .arrow {
    margin-left: 5px;
    font-size: 0.8em;
    transition: transform 0.3s;
}

.dropdown.active .arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    padding: 5px 0;
}

.dropdown.active .dropdown-content {
    display: block;
    animation: fadeInDropdown 0.2s;
}

.dropdown-content a {
    color: var(--kolor-ciemny);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    background: transparent;
    border-radius: 0;
    margin: 0;
}

@media (hover: hover) and (pointer: fine) {
    .dropdown-content a:hover {
        background-color: #f1f1f1;
        color: var(--kolor-glowny);
        transform: none;
    }
}

/* Hamburger */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    width: 30px;
    height: 24px;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* User Menu */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.user-dropdown button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
    border-radius: 4px;
    transition: background 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .user-dropdown button:hover {
        background: #f1f1f1;
    }
}

.dropdown-header {
    padding: 10px;
    font-weight: bold;
    color: var(--kolor-glowny);
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    font-size: 0.9em;
}

@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    .nav-links, .nav-actions {
        display: none;
    }

    .desktop-text {
        display: inline;
    }

    .nawigacja.active {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 20px;
    }

    .nawigacja.active .hamburger {
        align-self: flex-start;
        margin-bottom: 20px;
    }

    .nawigacja {
        justify-content: space-between;
    }

    .nawigacja.active .nav-links,
    .nawigacja.active .nav-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
        animation: slideDownMenu 0.3s ease forwards;
    }

    .nawigacja.active .nav-actions {
        margin-top: 15px;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 15px;
    }

    /* Staggered animation for links */
    .nawigacja.active .nav-links > *,
    .nawigacja.active .nav-actions > * {
        opacity: 0;
        animation: slideInRight 0.3s ease forwards;
    }

    .nawigacja.active .nav-links > *:nth-child(1) { animation-delay: 0.1s; }
    .nawigacja.active .nav-links > *:nth-child(2) { animation-delay: 0.15s; }
    .nawigacja.active .nav-links > *:nth-child(3) { animation-delay: 0.2s; }
    .nawigacja.active .nav-links > *:nth-child(4) { animation-delay: 0.25s; }

    .nawigacja.active .nav-actions > *:nth-child(1) { animation-delay: 0.3s; }
    .nawigacja.active .nav-actions > *:nth-child(2) { animation-delay: 0.35s; }
    .nawigacja.active .nav-actions > *:nth-child(3) { animation-delay: 0.4s; }

    .nawigacja.active a,
    .nawigacja.active button:not(.hamburger),
    .nawigacja.active .dropbtn {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        border-radius: 8px;
        background: rgba(255,255,255,0.05);
    }

    .dropdown {
        width: 100%;
        display: block;
    }

    .dropdown-content {
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        margin-top: 5px;
    }

    .dropdown-content a {
        color: white;
        padding-left: 40px;
    }

    @media (hover: hover) and (pointer: fine) {
        .dropdown-content a:hover {
            background: rgba(255,255,255,0.1);
            color: white;
        }
    }

    .user-dropdown {
        right: -50px;
        min-width: 200px;
    }
}

@media (max-width: 600px) {
    header { padding-top: 40px; }
    .nawigacja a { padding: 6px 12px; font-size: 0.85em; }
}

/* MOBILE RESPONSIVE NAV */
/* =========================================
   GŁÓWNY KONTENER TREŚCI (MAIN)
   ========================================= */
main {
    max-width: 900px;
    width: 95%;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
    main {
        padding: 45px;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--kolor-glowny);
    font-size: 0.9em;
}

.opis-wsi {
    font-style: italic;
    color: #555;
    background: #fffdf0;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    margin-bottom: 30px;
}

h2,
section {
    scroll-margin-top: 80px;
}

h2 {
    color: var(--kolor-ciemny);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 30px;
}

/* =========================================
   STOPKA (FOOTER)
   ========================================= */
.stopka {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--kolor-ciemny);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .footer-links a:hover {
        color: var(--kolor-glowny);
    }
}

.separator {
    color: #ccc;
    font-size: 0.8em;
}
