/* BMW G30 M Sport - Custom CSS - NAPRAWIONY */

body {
    font-family: 'Inter', sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Custom scrollbar with M Performance colors */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3b82f6, #dc2626, #7c3aed);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #2563eb, #b91c1c, #6d28d9);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom selection with M Performance colors */
::selection {
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.2), rgba(220, 38, 38, 0.2), rgba(124, 58, 237, 0.2));
    color: #1f2937;
}

/* Subtle cursor trail effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(59, 130, 246, 0.02) 0%, 
                rgba(220, 38, 38, 0.015) 25%, 
                rgba(124, 58, 237, 0.01) 50%, 
                transparent 70%);
    transition: all 0.3s ease;
}

/* Nieregularne kształty w tle */
.irregular-shape {
    position: absolute;
    opacity: 0.03;
    filter: blur(30px);
    animation: float 6s ease-in-out infinite;
}

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

/* Gallery - WZMOCNIONE STYLE */
.gallery-item {
    cursor: pointer !important;
    transition: all 0.5s ease !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    background: white !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.gallery-item:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    z-index: 10 !important;
}

.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: all 0.5s ease !important;
    pointer-events: none !important;
}

/* Lightbox - MAKSYMALNIE WZMOCNIONY */
.lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

.lightbox.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.lightbox img {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
    background: white !important;
    padding: 4px !important;
}

.lightbox-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    color: #333 !important;
    border: none !important;
    padding: 0.75rem !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000000 !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1) !important;
}

.lightbox-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    color: #333 !important;
    border: none !important;
    padding: 0.75rem !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000000 !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.lightbox-prev {
    left: 1rem !important;
}

.lightbox-next {
    right: 1rem !important;
}

.lightbox-counter {
    position: absolute !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    color: #333 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 9999px !important;
    font-weight: 600 !important;
    z-index: 1000000 !important;
    font-size: 14px !important;
}

/* Blokada scroll gdy lightbox otwarty */
body.lightbox-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px !important;
        height: 40px !important;
        padding: 0.5rem !important;
        font-size: 16px !important;
    }
    
    .lightbox-close {
        width: 40px !important;
        height: 40px !important;
        padding: 0.5rem !important;
        font-size: 16px !important;
    }
    
    .lightbox img {
        max-width: 95vw !important;
        max-height: 85vh !important;
    }
    
    .lightbox-counter {
        font-size: 12px !important;
        padding: 0.4rem 0.8rem !important;
    }
}

/* Loading animation */
body:not(.loaded) {
    overflow: hidden;
}

body.loaded .loading-overlay {
    opacity: 0;
    visibility: hidden;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #60a5fa, #1e3a8a, #dc2626);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 1s ease-out;
}

/* Animation classes */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.group {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.group.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Dodatkowe zabezpieczenia */
.lightbox * {
    box-sizing: border-box !important;
}

/* Wymuszenie widoczności lightbox */
.lightbox[style*="display: flex"] {
    display: flex !important;
}

.lightbox[style*="opacity: 1"] {
    opacity: 1 !important;
}

/* Dodatkowe style dla pewności */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
    cursor: pointer;
}

/* Hover effect dla gallery items */
.gallery-item:hover::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}