/* Krytyczne style dla szybszego renderowania */
:root {
    --bg-primary: #e5e7eb;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #374151;
    --accent-primary: #166534;
    --accent-secondary: #1e40af;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    --footer-bg: #111827;
    --footer-text: #e5e7eb;
    --feature-tag-bg: #d1d5db;
    --feature-icon-color: #111827;
    --feature-text-color: #111827;
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --accent-primary: #16a34a;
    --accent-secondary: #2563eb;
    --card-bg: #374151;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --footer-bg: #111827;
    --footer-text: #f9fafb;
    --feature-tag-bg: #4b5563;
    --feature-icon-color: #f9fafb;
    --feature-text-color: #f9fafb;
}

body {
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    padding: 0;
}

/* === Galeria === */
.gallery-grid {
    display: grid;
    gap: 1rem;
    padding: 0.5rem;
}

@media (max-width: 640px) {
    .gallery-grid { grid-template-columns: repeat(1, 1fr); }
    .gallery-item { aspect-ratio: 4/3; }
}
@media (min-width: 641px) and (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-item { aspect-ratio: 4/3; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-item { aspect-ratio: 16/10; }
}
@media (min-width: 1025px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    .gallery-item { aspect-ratio: 16/10; }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-color: var(--bg-secondary);
}

.gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 
                0 10px 10px -5px rgba(0, 0, 0, 0.08);
    z-index: 1;
}

.gallery-item button {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.05);
}

.gallery-item::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.gallery-grid > .gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 768px) {
    .gallery-grid > .gallery-item:first-child {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.gallery-item.loading {
    background: linear-gradient(90deg, 
        var(--bg-primary) 0%, 
        var(--bg-secondary) 50%, 
        var(--bg-primary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-section-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.gallery-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* === Lightbox === */
.lightbox {
    touch-action: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active {
    display: flex;
    opacity: 1;
    touch-action: none;
    overscroll-behavior: contain;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.5s ease;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    will-change: transform, opacity;
}

.lightbox.active img {
    transform: scale(1);
    opacity: 1;
}

@media (hover: hover) {
    .lightbox img { cursor: grab; }
    .lightbox img:active { cursor: grabbing; }
}

.lightbox-close, .lightbox-nav {
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox-close:hover, .lightbox-close:focus,
.lightbox-nav:hover, .lightbox-nav:focus {
    color: var(--accent-primary);
    transform: scale(1.2);
    outline: 2px solid var(--accent-primary);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1001;
}

@media (max-width: 768px) {
    .lightbox-nav {
        background: rgba(0, 0, 0, 0.5);
        padding: 15px 10px;
        border-radius: 50%;
    }
    
    .lightbox img {
        max-width: 95%;
        max-height: 85%;
    }
}

/* === Pozostałe style === */
.bg-white { background-color: var(--bg-secondary) !important; }
.bg-gray-100 { background-color: var(--bg-primary) !important; }
.text-gray-800 { color: var(--text-primary) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.bg-gray-200 { background-color: var(--feature-tag-bg) !important; }
.bg-gray-800 { background-color: var(--footer-bg) !important; }
.text-gray-400 { color: var(--footer-text) !important; }

.hero {
    background-image: url('../../narzedzia/pok.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,100,0,0.4) 0%, rgba(0,0,50,0.4) 100%);
    pointer-events: none;
}

.slide-up {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.slide-up.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: white !important;
    transition: color 0.3s ease;
}

#navbar.bg-white .nav-link {
    color: var(--text-primary) !important;
}

.nav-link:hover, .nav-link:focus {
    color: var(--accent-primary) !important;
    outline: 2px solid var(--accent-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-primary);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after, .nav-link:focus::after {
    width: 100%;
}

.cabin-card, .feature-card, .pricing-table td, .testimonial .bg-gray-100, .faq-answer, .contact .bg-white {
    background-color: var(--card-bg) !important;
    box-shadow: var(--card-shadow);
}

.pricing-table tr:nth-child(even) td {
    background-color: var(--bg-primary) !important;
}

.cabin-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cabin-card:hover, .cabin-card:focus-within {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.floating {
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { transform: translate(-50%, 0); opacity: 0.3; }
    50% { transform: translate(-50%, 10px); opacity: 1; }
    100% { transform: translate(-50%, 20px); opacity: 0.3; }
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--bg-primary);
    border-top: 5px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.parallax-section {
    position: relative;
    height: 400px;
    background-image: url('../../narzedzia/parallax.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-position 0.5s ease;
}

.parallax-section h2 {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.parallax-section p {
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s, opacity 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s;
}

.parallax-section.visible h2,
.parallax-section.visible p {
    transform: translateY(0);
    opacity: 1;
}

.bg-green-700 {
    background-color: var(--accent-primary) !important;
}

.bg-blue-600 {
    background-color: var(--accent-secondary) !important;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th, .pricing-table td {
    border: 1px solid var(--bg-primary);
    padding: 12px;
    text-align: left;
    transition: background-color 0.3s ease;
}

.pricing-table th {
    background-color: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
}

.pricing-table tr:hover td {
    background-color: rgba(22, 101, 52, 0.1);
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px;
    background-color: var(--accent-primary);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    transition: background-color 0.3s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle:hover, .theme-toggle:focus {
    background-color: var(--accent-secondary);
    transform: rotate(360deg);
    outline: 2px solid var(--accent-secondary);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--feature-tag-bg);
    color: var(--feature-text-color);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 9999px;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-tag:hover {
    transform: scale(1.05);
}

.feature-tag i {
    color: var(--feature-icon-color);
    font-size: 1.2rem;
    margin-right: 6px;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-tag:hover i {
    transform: rotate(5deg);
}

a:focus, button:focus, .faq-question:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.faq-question {
    width: 100%;
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.faq-question:hover {
    transform: translateY(-2px);
}

.faq-answer {
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.faq-answer:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.regulations-link {
    color: var(--accent-primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.regulations-link:hover, .regulations-link:focus {
    color: var(--accent-secondary);
    transform: scale(1.05);
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.regulations-heading {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.regulations-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 10px;
}

.regulations-content li {
    margin-bottom: 5px;
}

.reservation-terms {
    margin-top: 12px;
    padding: 12px;
    background-color: var(--bg-primary);
    border-radius: 8px;
    line-height: 1.5;
    font-size: 0.9rem;
    position: relative;
    z-index: 100000;
}

.review-slider {
    overflow: hidden;
    padding: 10px 0;
}

.review-card {
    padding: 0 12px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.review-card[style*="display: block"] {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 767px) {
    .review-card {
        width: 100%;
        flex: 0 0 100%;
    }

    #review-dots {
        display: flex;
        flex-wrap: wrap;
        max-width: 200px;
        justify-content: center;
        margin: 0 auto;
    }

    .review-dot {
        margin: 4px;
    }
}

@media (min-width: 768px) {
    .review-card {
        width: 33.333%;
        flex: 0 0 33.333%;
    }
}

.review-dot {
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
}

.review-dot:hover, .review-dot:focus {
    transform: scale(1.3);
    background-color: var(--accent-primary) !important;
}

#prev-review, #next-review {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s ease;
}

#prev-review:hover, #next-review:hover,
#prev-review:focus, #next-review:focus {
    transform: scale(1.15);
    background-color: var(--accent-secondary) !important;
}

[data-theme="dark"] .review-card > div {
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
}

[data-theme="dark"] .review-card p {
    color: var(--text-secondary);
}

[data-theme="dark"] .review-dot {
    background-color: var(--text-secondary);
}

[data-theme="dark"] .review-dot.active {
    background-color: var(--accent-primary);
}

.tippy-box {
    max-width: 600px !important;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    line-height: 1.6;
    font-size: 0.9rem;
    z-index: 99999 !important;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.4s ease;
}

.tippy-box[data-state="visible"] {
    transform: scale(1);
    opacity: 1;
}

.tippy-arrow {
    color: var(--bg-secondary);
}