/* General styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 76px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Navigation */
.navbar {
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.8) !important;
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed navbar */
section[id] {
    scroll-margin-top: 90px;
}

/* Specific rule for contact section */
section#kontakt {
    scroll-margin-top: 100px;
}

.navbar-brand img {
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

/* Hero Section */
#hero {
    position: relative;
    margin-top: -76px;
    background: #000;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 500px;
    will-change: transform;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    content-visibility: auto;
    contain-intrinsic-size: 300px;
    will-change: transform;
    opacity: 0;
    transform: translateY(20px);
    animation: heroContentFadeIn 0.8s ease-out forwards;
}

@keyframes heroContentFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.light-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Efekt ruchomych głów - promienie świetlne */
.light-effect::before,
.light-effect::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(30px);
    animation: moveLight 8s infinite;
}

.light-effect::before {
    background: radial-gradient(circle, rgba(255,0,128,0.4) 0%, transparent 70%);
    top: 30%;
    left: 20%;
    animation: moveLight1 8s infinite;
}

.light-effect::after {
    background: radial-gradient(circle, rgba(0,128,255,0.4) 0%, transparent 70%);
    top: 40%;
    right: 20%;
    animation: moveLight2 8s infinite;
}

/* Dodatkowe promienie */
.light-beam {
    position: absolute;
    width: 100px;
    height: 800px;
    background: linear-gradient(to bottom, 
        rgba(255,255,255,0.1) 0%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.1) 100%);
    filter: blur(5px);
    transform-origin: top;
    animation: rotateBeam 10s infinite;
}

.light-beam:nth-child(1) {
    top: -200px;
    left: 20%;
    animation-delay: 0s;
    background: linear-gradient(to bottom, 
        rgba(255,0,128,0.1) 0%,
        rgba(255,0,128,0.2) 50%,
        rgba(255,0,128,0.1) 100%);
}

.light-beam:nth-child(2) {
    top: -200px;
    left: 40%;
    animation-delay: -2s;
    background: linear-gradient(to bottom, 
        rgba(0,128,255,0.1) 0%,
        rgba(0,128,255,0.2) 50%,
        rgba(0,128,255,0.1) 100%);
}

.light-beam:nth-child(3) {
    top: -200px;
    right: 40%;
    animation-delay: -4s;
    background: linear-gradient(to bottom, 
        rgba(255,255,0,0.1) 0%,
        rgba(255,255,0,0.2) 50%,
        rgba(255,255,0,0.1) 100%);
}

.light-beam:nth-child(4) {
    top: -200px;
    right: 20%;
    animation-delay: -6s;
    background: linear-gradient(to bottom, 
        rgba(128,0,255,0.1) 0%,
        rgba(128,0,255,0.2) 50%,
        rgba(128,0,255,0.1) 100%);
}

@keyframes moveLight1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    25% { transform: translate(100px, 100px) scale(1.5); opacity: 0.8; }
    50% { transform: translate(200px, -100px) scale(1); opacity: 0.6; }
    75% { transform: translate(-100px, -50px) scale(1.5); opacity: 0.8; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
}

@keyframes moveLight2 {
    0% { transform: translate(0, 0) scale(1.5); opacity: 0.8; }
    25% { transform: translate(-100px, -100px) scale(1); opacity: 0.6; }
    50% { transform: translate(-200px, 100px) scale(1.5); opacity: 0.8; }
    75% { transform: translate(100px, 50px) scale(1); opacity: 0.6; }
    100% { transform: translate(0, 0) scale(1.5); opacity: 0.8; }
}

@keyframes rotateBeam {
    0% { transform: rotate(-45deg) translateY(0); opacity: 0.3; }
    25% { transform: rotate(45deg) translateY(-100px); opacity: 0.7; }
    50% { transform: rotate(-45deg) translateY(0); opacity: 0.3; }
    75% { transform: rotate(45deg) translateY(-100px); opacity: 0.7; }
    100% { transform: rotate(-45deg) translateY(0); opacity: 0.3; }
}

#hero h1 {
    font-weight: 700;
    font-display: swap;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    margin: 0;
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    will-change: transform, opacity;
}

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

/* Remove animation for better LCP */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255,255,255,0.8),
                     0 0 20px rgba(255,255,255,0.5),
                     0 0 30px rgba(255,255,255,0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(255,255,255,0.8),
                     0 0 30px rgba(255,255,255,0.5),
                     0 0 40px rgba(255,255,255,0.3);
    }
}

#hero h2 {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Sections */
section {
    padding: 100px 0;
}

h2 {
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
}

h2:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--bs-primary);
    margin: 20px auto 0;
}

/* Cards */
.card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Gallery */
.gallery-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.gallery-scroll {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0;
    gap: 1rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    margin: 0 -1rem;
}

.gallery-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.gallery-item {
    flex: 0 0 auto;
    width: 300px;
    transition: transform 0.3s ease;
    margin: 0;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: block;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    z-index: 10;
}

.gallery-controls button {
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.gallery-controls button:hover {
    background: rgba(0,0,0,0.7);
}

/* Ensure proper spacing in the gallery section */
#galeria {
    padding: 3rem 0;
}

#galeria .container {
    position: relative;
}

/* Hide scroll buttons when not needed */
.gallery-controls button.hidden {
    display: none;
}

.video-item {
    margin-bottom: 30px;
}

.video-item video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Gallery Tabs */
#galleryTabs {
    border-bottom: none;
}

#galleryTabs .nav-link {
    color: #666;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

#galleryTabs .nav-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

#galleryTabs .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

/* Lightbox customization */
.lb-data .lb-caption {
    font-size: 16px;
    font-weight: 500;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.8;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
    opacity: 1;
}

/* Lazy loading animation */
.gallery-item.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* Contact Form */
.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}

/* Buttons */
.btn-primary {
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    #hero h1 {
        font-size: 2.5rem;
    }
    
    .navbar-brand img {
        height: 40px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary-dark);
}

/* Gallery Styles */
.gallery-section {
    padding: 4rem 0;
    background-color: #f8f9fa;
    contain: layout style paint;
    /* content-visibility removed to avoid anchor scroll misalignment */
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

#nanogallery2, #nanogallery2-videos {
    margin-bottom: 3rem;
}

.nanogallery2_theme_default .nGY2GThumbnail {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
}

.nanogallery2_theme_default .nGY2GThumbnail:hover {
    transform: scale(1.05);
}

.nanogallery2_theme_default .nGY2GThumbnail.loaded {
    background-color: transparent;
}

.nanogallery2_theme_default .nGY2GThumbnail img {
    transition: filter 0.3s ease;
}

.nanogallery2_theme_default .nGY2GThumbnail img.blur-up {
    filter: blur(5px);
}

.nanogallery2_theme_default .nGY2GThumbnail img.loaded {
    filter: blur(0);
}

.nanogallery2_theme_default .nGY2GViewer {
    background-color: rgba(0,0,0,0.9);
}

.nanogallery2_theme_default .nGY2GViewerToolbar {
    background-color: rgba(0,0,0,0.8);
}

.nanogallery2_theme_default .nGY2GViewerToolbarButton {
    color: #fff;
}

.nanogallery2_theme_default .nGY2GViewerToolbarButton:hover {
    color: #ff6b6b;
}

.nanogallery2_theme_default .nGY2GViewerNext,
.nanogallery2_theme_default .nGY2GViewerPrev {
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 15px;
}

.nanogallery2_theme_default .nGY2GViewerNext:hover,
.nanogallery2_theme_default .nGY2GViewerPrev:hover {
    background-color: rgba(0,0,0,0.8);
}

.nanogallery2_theme_default .nGY2GViewerClose {
    top: 20px;
    right: 20px;
}

.nanogallery2_theme_default .nGY2GViewerClose:hover {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .gallery-swiper .swiper-slide {
        height: 300px;
    }
    
    .gallery-thumbs {
        height: 80px;
    }
    
    .gallery-thumbs .swiper-slide {
        width: 80px;
        height: 80px;
    }
} 

.about-header {
    text-align: center;
}

/* Image optimization */
img {
    content-visibility: auto;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Lazy loading for images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
    background-color: #f8f9fa;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize rendering */
#hero {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    transform-style: preserve-3d;
}

/* Optimize paint */
#hero h1 {
    transform: translateZ(0);
    backface-visibility: hidden;
    text-shadow: 0 0 10px rgba(255,255,255,0.8),
                 0 0 20px rgba(255,255,255,0.5),
                 0 0 30px rgba(255,255,255,0.3);
    transition: text-shadow 0.3s ease;
}

#hero h1:hover {
    text-shadow: 0 0 20px rgba(255,255,255,0.8),
                 0 0 30px rgba(255,255,255,0.5),
                 0 0 40px rgba(255,255,255,0.3);
}

/* Service Area Map Styles */
.service-area-map {
    position: relative;
    background: #fff;
    padding: 1rem;
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.service-area-map img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.map-legend {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.marker {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.marker.red {
    background-color: #ff0000;
}

.marker.blue {
    background-color: #0000ff;
}

@media (max-width: 768px) {
    .map-legend {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 1rem;
        background: #fff;
    }
}

/* Service Area List Styles */
.service-area-list {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.service-area-list .card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
}

.service-area-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.service-area-list .card-title {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.service-area-list ul li {
    margin-bottom: 0.5rem;
    color: #666;
}

.cities-list {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.cities-list p {
    margin: 0;
    color: #666;
}

@media (max-width: 768px) {
    .service-area-list {
        padding: 1rem;
    }
    
    .service-area-list .card {
        margin-bottom: 1rem;
    }
    
    .cities-list {
        padding: 1rem;
    }
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.gallery-image.loaded {
    opacity: 1;
}

.gallery-image:hover {
    transform: scale(1.05);
}

/* Placeholder dla obrazów podczas ładowania */
.gallery-image::before {
    content: '';
    display: block;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    background-color: #f8f9fa;
}