/* Main Styles */
:root {
    --primary: #E31E24;
    --primary-hover: #C11A20;
    --secondary: #2D2D2D;
    --muted: #F5F5F5;
}

/* Base Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
}

/* Focus Ring */
.focus-ring:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header Effects */
#header {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.backdrop-blur-header {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Gradients */
.gradient-bg {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(227, 30, 36, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(227, 30, 36, 0.05) 0%, transparent 50%);
}

/* Image Transitions */
#main-image {
    transition: opacity 0.3s ease-in-out;
}

.gallery-thumb {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

/* Logo Styles */
header a img[alt*="Logo"],
footer a img[alt*="Logo"] {
    display: block;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

header a:hover img[alt*="Logo"],
footer a:hover img[alt*="Logo"] {
    opacity: 0.8;
    transform: scale(1.05);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb.active {
    border: 2px solid var(--primary);
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Testimonials */
.testimonial-item {
    animation: fadeIn 0.4s ease-out;
}

.testimonial-dot {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Video Container */
#testimonials-video-container {
    transition: opacity 0.3s ease-in-out;
}

#testimonials-video-container iframe {
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Video Loading state */
#testimonials-video-container .loading {
    animation: pulse 2s infinite;
}

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

/* Language Switcher */
[data-lang] {
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

[data-lang]:hover {
    transform: scale(1.1);
}

[data-lang].active {
    opacity: 1 !important;
    border: 2px solid var(--primary);
}

/* Utility Classes */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.border-primary { border-color: var(--primary); }
.bg-muted { background-color: var(--muted); }

/* Responsive utilities */
@media (max-width: 768px) {
    .hero-pattern {
        background-size: 50% 50%;
    }
    
    #testimonials-video-container {
        border-radius: 8px;
    }
    
    #testimonials-video-container iframe {
        border-radius: 8px;
    }
    
    /* Responsive Logo */
    header a img[alt*="Logo"] {
        height: 2.5rem; /* 40px na mobile */
    }
}

/* ============================================
   TESTIMONIALS - FIX HEIGHT JUMPING
   ============================================ */

/* Stała wysokość kontenera opinii - zwiększona dla dłuższych tekstów */
#testimonials-container {
    min-height: 450px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
    padding: 2rem 0;
}

/* Item z elastyczną wysokością */
.testimonial-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Zmienione z center */
}

/* Quote z większą stałą wysokością */
.testimonial-item blockquote {
    min-height: 180px; /* Zwiększone z 120px */
    max-height: 280px; /* Zwiększone z 200px */
    overflow-y: auto;
    margin-bottom: 1.5rem;
    line-height: 1.6; /* Lepsze odstępy między wierszami */
    padding-right: 0.5rem; /* Przestrzeń dla scrollbara */
}

/* Scrollbar styling dla długich opinii */
.testimonial-item blockquote::-webkit-scrollbar {
    width: 6px;
}

.testimonial-item blockquote::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.testimonial-item blockquote::-webkit-scrollbar-thumb {
    background: rgba(227, 30, 36, 0.3);
    border-radius: 3px;
}

.testimonial-item blockquote::-webkit-scrollbar-thumb:hover {
    background: rgba(227, 30, 36, 0.5);
}

/* Avatar + Name section - stała wysokość */
.testimonial-item > div:last-child {
    min-height: 60px; /* Stała wysokość dla sekcji z avatarem */
}

/* Fade transition przy zmianie opinii */
#testimonials-container.transitioning {
    opacity: 0.3;
}

/* ============================================
   RESPONSIVE TESTIMONIALS
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    #testimonials-container {
        min-height: 480px;
        padding: 2rem 0;
    }
    
    .testimonial-item blockquote {
        min-height: 200px;
        max-height: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #testimonials-container {
        min-height: 520px;
        padding: 2rem 0;
    }
    
    .testimonial-item blockquote {
        min-height: 220px;
        max-height: 320px;
    }
}

/* Small Mobile */
@media (max-width: 640px) {
    #testimonials-container {
        min-height: 560px;
        padding: 2rem 0;
    }
    
    .testimonial-item blockquote {
        min-height: 240px;
        max-height: 340px;
    }
}

/* ============================================
   LAZY LOADING SECTIONS
   ============================================ */

/* Sekcje przed załadowaniem */
section[data-lazy-section] {
    min-height: 400px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    position: relative;
}

/* Placeholder podczas ładowania */
section[data-lazy-section]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #E31E24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Po załadowaniu */
section.section-loaded {
    animation: sectionFadeIn 0.5s ease-out;
}

section.section-loaded::after {
    display: none;
}

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

/* Obrazy lazy loaded */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

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

/* ============================================
   HERO VIMEO VIDEO BACKGROUND
   ============================================ */

/* Vimeo Background Container */
#vimeo-bg-container {
    overflow: hidden;
}

#vimeo-hero-player {
    pointer-events: none; /* Disable clicks on video */
    object-fit: cover;
    filter: brightness(1.05) contrast(0.95);
    transition: filter 0.5s ease;
}

/* Enhanced Glassmorphism */
.backdrop-blur-md {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* Text Shadows for Readability */
.drop-shadow-2xl {
    text-shadow: 
        0 4px 8px rgba(255, 255, 255, 0.9),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.drop-shadow-lg {
    text-shadow: 
        0 2px 6px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Stats Cards Hover Effect */
.bg-white\/85:hover {
    transform: translateY(-4px);
}

/* Smooth Section Transition */
section:has(#vimeo-hero-player) {
    position: relative;
}

/* Video Performance Optimization */
@media (prefers-reduced-motion: reduce) {
    #vimeo-hero-player {
        display: none;
    }
    
    section:has(#vimeo-hero-player) {
        background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    }
}

/* Mobile Adjustments - Hide video on small screens */
@media (max-width: 768px) {
    #vimeo-bg-container {
        display: none;
    }
    
    /* Fallback gradient background for mobile */
    section:has(#vimeo-hero-player) {
        background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
        background-image: 
            radial-gradient(circle at 20% 50%, rgba(227, 30, 36, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(227, 30, 36, 0.05) 0%, transparent 50%);
    }
    
    /* Remove extra shadows on mobile for better readability */
    .drop-shadow-2xl,
    .drop-shadow-lg {
        text-shadow: none;
    }
    
    /* Adjust stats cards on mobile */
    .bg-white\/85 {
        background-color: rgba(255, 255, 255, 0.95);
    }
    
    /* Testimonials - mobile adjustments */
    #testimonials-container {
        min-height: 320px;
    }
    
    .testimonial-item blockquote {
        min-height: 140px;
        max-height: 220px;
        font-size: 1.125rem;
    }
}

/* Extra small screens */
@media (max-width: 640px) {
    #testimonials-container {
        min-height: 360px;
    }
    
    .testimonial-item blockquote {
        min-height: 160px;
        max-height: 240px;
        font-size: 1rem;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    #vimeo-hero-player {
        transform: translate(-50%, -50%) scale(1.3) !important;
    }
}

/* Large Screens */
@media (min-width: 1920px) {
    #vimeo-hero-player {
        transform: translate(-50%, -50%) scale(1.2) !important;
    }
}

/* ============================================
   GALLERY ENHANCEMENTS - V2 (Full images)
   ============================================ */

/* ============================================
   GALLERY - SIMPLE GRID LAYOUT
   ============================================ */

/* Gallery grid - równa wysokość wszystkich kolumn */
.grid.lg\:grid-cols-4 > div {
    height: 100%;
}

/* Hover effect na zdjęciach */
.grid img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.grid img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Responsywność */
@media (max-width: 1024px) {
    /* Tablet - 3 kolumny */
    .grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* 4. kolumna zajmuje pełną szerokość */
    .grid.lg\:grid-cols-4 > div:nth-child(4) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Mobile - 2 kolumny */
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* 4. kolumna zajmuje pełną szerokość i ma 2 kolumny */
    .grid.lg\:grid-cols-4 > div:nth-child(4) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
}

@media (max-width: 640px) {
    /* Small mobile - 1 kolumna */
    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    /* 4. kolumna również 1 kolumna */
    .grid.lg\:grid-cols-4 > div:nth-child(4) {
        grid-template-columns: 1fr !important;
    }
}

/* AUTO-DUBBING INDICATOR */
.auto-dubbing-indicator {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Migająca kropka */
.auto-dubbing-indicator .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

/* Hover effect dla wskaźnika */
.auto-dubbing-indicator:hover {
    opacity: 0.8;
}

/* HERO VIDEO STYLING */