/* =============================================================================
   HERO CAROUSEL STYLES
   Responsive carousel for homepage hero section with theme support
   ============================================================================= */

/* Hero Section with Filters Overlay */
.hero.hero-with-filters {
    position: relative;
    padding: 0;
    margin: 0;
    overflow: visible;
    background: transparent;
}

/* Hero Carousel Wrapper - Full width background */
.hero-carousel-wrapper {
    position: relative;
    width: 100%;
}

/* Carousel Container - Full width, no border radius */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
}

/* Carousel Wrapper */
.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Hero Filters Overlay - positioned at bottom of hero */
.hero-filters-overlay {
    position: relative;
    width: 100%;
    z-index: 20;
    margin-top: -100px; /* Overlap the carousel */
    padding-bottom: var(--space-8);
}

.hero-filters-overlay .container {
    position: relative;
}

/* Search filter container when overlaid on hero */
.search-filter-container.search-filter-overlay {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .search-filter-container.search-filter-overlay {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Carousel Panels Container */
.carousel-panels {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Individual Carousel Panel */
.carousel-panel {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Panel Overlay for better text readability */
.carousel-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

/* Panel Content */
.carousel-panel-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

/* Text Alignment Options */
.carousel-panel-content.text-left {
    text-align: left;
    margin-right: auto;
    margin-left: 2rem;
}

.carousel-panel-content.text-center {
    text-align: center;
    margin: 0 auto;
}

.carousel-panel-content.text-right {
    text-align: right;
    margin-left: auto;
    margin-right: 2rem;
}

/* Panel Title */
.carousel-panel-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Panel Subtitle */
.carousel-panel-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* CTA Button */
.carousel-cta-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    background-color: var(--primary-color, #C11A1A);
    color: white;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(193, 26, 26, 0.3);
}

.carousel-cta-button:hover {
    background-color: var(--primary-hover, #A01515);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(193, 26, 26, 0.4);
}

.carousel-cta-button:active {
    transform: translateY(0);
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav.prev {
    left: 1.5rem;
}

.carousel-nav.next {
    right: 1.5rem;
}

/* Pagination Dots */
.carousel-pagination {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: white;
    width: 32px;
    border-radius: 6px;
}

/* Loading State */
.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--bg-secondary, #f5f5f5);
}

.carousel-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #C11A1A);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Theme Support - Light Mode */
[data-theme="light"] .carousel-panel::before {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

/* Theme Support - Dark Mode */
[data-theme="dark"] .carousel-panel::before {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

[data-theme="dark"] .carousel-loading {
    background: var(--bg-secondary, #1e1e1e);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .hero-carousel {
        height: 400px;
        border-radius: 8px;
    }

    .carousel-panel-content {
        padding: 1.5rem;
        max-width: 90%;
    }

    .carousel-panel-content.text-left {
        margin-left: 1rem;
    }

    .carousel-panel-content.text-right {
        margin-right: 1rem;
    }

    .carousel-panel-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .carousel-panel-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .carousel-cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Hide navigation buttons on mobile, use swipe instead */
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-nav.prev {
        left: 0.75rem;
    }

    .carousel-nav.next {
        right: 0.75rem;
    }

    .carousel-pagination {
        bottom: 1rem;
        gap: 0.5rem;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .carousel-dot.active {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .hero-carousel {
        height: 320px;
    }

    .carousel-panel-title {
        font-size: 1.5rem;
    }

    .carousel-panel-subtitle {
        font-size: 0.875rem;
    }

    .carousel-cta-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-panels {
        transition: none;
    }

    .carousel-nav,
    .carousel-dot,
    .carousel-cta-button {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .carousel-nav,
    .carousel-pagination {
        display: none;
    }

    .hero-carousel {
        height: auto;
        box-shadow: none;
    }
}
