/*
 * PREMIUM CAROUSEL ENHANCEMENTS
 * Advanced visual effects for hero section
 */

/* ============================================
   ADVANCED CAROUSEL EFFECTS
   ============================================ */

.hero-section-full-height {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* Animated gradient overlay */
.carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(91, 193, 172, 0.15) 0%,
        rgba(102, 126, 234, 0.15) 50%,
        rgba(118, 75, 162, 0.15) 100%
    );
    z-index: 1;
    pointer-events: none;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 0.3;
        background-position: 0% 50%;
    }
    50% {
        opacity: 0.6;
        background-position: 100% 50%;
    }
}

/* Particle effect overlay */
.carousel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px;
    animation: particleFloat 30s linear infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes particleFloat {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: 200px 200px, -300px 300px, 250px -250px;
    }
}

/* Enhanced carousel item transitions */
.carousel-item {
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
    position: relative;
}

.carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

.carousel-item.active::before {
    opacity: 1;
}

/* Premium image effects */
.carousel-image {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    transition: transform 12s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(0.85) contrast(1.1) saturate(1.2);
}

.carousel-item.active .carousel-image {
    animation: kenBurnsPremium 12s ease-in-out forwards;
    filter: brightness(0.9) contrast(1.15) saturate(1.3);
}

@keyframes kenBurnsPremium {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.15) rotate(1deg);
    }
    100% {
        transform: scale(1.1) rotate(0deg);
    }
}

/* Ultra-premium caption design - Compact Corner Card
   High specificity to override conflicts from:
   - templatemo-kind-heart-charity.css (line 577)
   - modern-enhancements.css (line 322)
   - innovation-blue-theme.css (line 66)
*/

#hero-slide .carousel-item .carousel-caption,
.carousel .carousel-item .carousel-caption,
.carousel-caption {
    position: absolute !important;
    bottom: 30%; /* 60px original*/
    right: 60px;
    left: auto;
    top: auto !important;
    transform: none !important;
    width: auto !important;
    max-width: 500px !important;
    z-index: 10 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 2px solid rgba(0, 102, 255, 0.4) !important;
    border-radius: 20px !important;
    padding: 30px 35px !important;
    margin-bottom: 0 !important;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(0, 102, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
    text-align: left !important;
    clip-path: none !important;
    animation: none !important;
}

/* Animated background gradient in caption */
.carousel-caption::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 102, 255, 0.05) 50%,
        transparent 70%
    );
    animation: captionGlow 8s ease infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes captionGlow {
    0%, 100% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateX(50%) translateY(50%) rotate(180deg);
        opacity: 0.6;
    }
}

/* Premium typography - Compact Card */
.carousel-caption h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 12px;
    position: relative !important;
    z-index: 10 !important;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 102, 255, 0.4);
    animation: titleReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block !important;
    visibility: visible !important;
    max-width: 100%;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Gradient text effect */
.carousel-caption h1 span {
    background: linear-gradient(135deg, #5bc1ac 0%, #667eea 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientText 5s ease infinite;
}

@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.carousel-caption p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 18px;
    position: relative !important;
    z-index: 10 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    animation: subtitleReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s backwards;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block !important;
    visibility: visible !important;
    max-width: 100%;
}

@keyframes subtitleReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Premium CTA buttons in carousel - Compact Card */
.carousel-cta-group {
    display: flex !important;
    gap: 10px;
    justify-content: flex-start;
    position: relative !important;
    z-index: 10 !important;
    align-items: center;
    margin-top: 15px;
    animation: ctaReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s backwards;
    flex-wrap: wrap;
    visibility: visible !important;
}

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

.carousel-cta-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative !important;
    z-index: 10 !important;
    overflow: visible;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    text-decoration: none;
    white-space: nowrap;
    visibility: visible !important;
}

.carousel-cta-btn-primary {
    background: linear-gradient(135deg, #5bc1ac 0%, #667eea 100%);
    color: white;
    box-shadow:
        0 10px 30px rgba(91, 193, 172, 0.4),
        0 0 0 0 rgba(91, 193, 172, 0.5);
    animation: pulseGlow 3s ease infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow:
            0 10px 30px rgba(91, 193, 172, 0.4),
            0 0 0 0 rgba(91, 193, 172, 0.5);
    }
    50% {
        box-shadow:
            0 10px 40px rgba(91, 193, 172, 0.6),
            0 0 0 15px rgba(91, 193, 172, 0);
    }
}

.carousel-cta-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.carousel-cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.carousel-cta-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 15px 50px rgba(91, 193, 172, 0.6),
        0 0 0 0 rgba(91, 193, 172, 0);
}

.carousel-cta-btn:hover::before {
    opacity: 1;
}

.carousel-cta-btn i {
    transition: transform 0.4s ease;
}

.carousel-cta-btn:hover i {
    transform: translateX(5px);
}

/* Modern carousel indicators */
.carousel-indicators {
    bottom: 40px;
    z-index: 10;
    margin-bottom: 0;
    gap: 15px;
}

.carousel-indicators [data-bs-target] {
    width: 50px;
    height: 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.carousel-indicators [data-bs-target]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #5bc1ac, #667eea);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.carousel-indicators .active {
    width: 80px;
    background: rgba(255, 255, 255, 0.5);
}

.carousel-indicators .active::before {
    transform: translateX(0);
    animation: indicatorProgress 8s linear;
}

@keyframes indicatorProgress {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Ultra-premium carousel controls */
.carousel-control-prev,
.carousel-control-next {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.hero-section:hover .carousel-control-prev,
.hero-section:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev {
    left: 50px;
}

.carousel-control-next {
    right: 50px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.15);
    box-shadow:
        0 15px 50px rgba(91, 193, 172, 0.4),
        0 0 30px rgba(91, 193, 172, 0.3);
}

/* Floating stats overlay */
.carousel-stats {
    position: absolute;
    bottom: 180px;
    left: 50px;
    z-index: 5;
    display: flex;
    gap: 25px;
    animation: statsReveal 1.2s ease 1.2s backwards;
}

@keyframes statsReveal {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 18px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    transition: all 0.4s ease;
}

.carousel-stat-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.carousel-stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: block;
    margin-bottom: 3px;
}

.carousel-stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.scroll-indicator-icon {
    width: 40px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-indicator-icon::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 10px;
    background: white;
    border-radius: 3px;
    animation: scrollDot 2s infinite;
}

@keyframes scrollDot {
    0%, 100% {
        top: 10px;
        opacity: 1;
    }
    50% {
        top: 30px;
        opacity: 0.3;
    }
}

.scroll-indicator:hover .scroll-indicator-icon {
    border-color: #5bc1ac;
    transform: translateY(-5px);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .carousel-caption {
        padding: 40px 30px;
        bottom: 10%;
        width: 95%;
        border-radius: 20px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute !important;
    }

    .carousel-caption h1 {
        font-size: 3rem;
        letter-spacing: 2px;
        color: white !important;
    }

    .carousel-caption p {
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.95) !important;
    }

    .carousel-cta-group {
        flex-direction: column;
        gap: 15px;
    }

    .carousel-cta-btn {
        width: 100%;
        justify-content: center;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 50px;
        height: 50px;
    }

    .carousel-control-prev {
        left: 20px;
    }

    .carousel-control-next {
        right: 20px;
    }

    .carousel-stats {
        bottom: auto;
        top: 80px;
        left: 20px;
        right: 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .carousel-stat-item {
        flex: 1;
        min-width: 100px;
        padding: 12px 16px;
    }

    .carousel-stat-number {
        font-size: 1.6rem;
    }

    .carousel-stat-label {
        font-size: 0.7rem;
    }
}

/* Tablet portrait fixes */
@media (max-width: 768px) and (min-width: 577px) {
    .carousel-caption {
        padding: 30px 25px;
        width: 90%;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border-radius: 20px !important;
    }

    .carousel-caption::before {
        opacity: 0.3;
    }

    .carousel-caption h1 {
        font-size: 2.5rem;
        letter-spacing: 1px;
    }

    .carousel-caption p {
        font-size: 1.1rem;
    }

    .carousel-stats {
        top: 100px;
        gap: 10px;
    }

    .carousel-stat-item {
        padding: 14px 20px;
    }

    .carousel-stat-number {
        font-size: 1.8rem;
    }

    .carousel-stat-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    /* Fix distorted carousel on mobile */
    .hero-section-full-height {
        min-height: auto;
        height: 100vh;
    }

    .carousel-image {
        height: 100vh;
        object-fit: cover;
        object-position: center;
    }

    /* Remove dark overlay that creates triangle on mobile */
    .carousel-item::before {
        display: none !important;
    }

    .carousel-item.active::before {
        display: none !important;
    }

    .carousel-caption {
        padding: 15px 18px !important;
        top: 10% !important;
        bottom: 30% !important;
        width: auto !important;
        max-width: 90% !important;
        left: 15px !important;
        right: 15px !important;
        transform: translate(-50%, -50%) !important;
        -webkit-transform: translate(-50%, -50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border-radius: 15px !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        z-index: 100 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: auto !important;
        height: auto !important;
    }

    /* Disable caption before element on mobile */
    .carousel-caption::before {
        display: none !important;
    }

    .carousel-caption h1 {
        font-size: 1.6rem !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 8px !important;
        margin-top: 0 !important;
        color: white !important;
        display: block !important;
        visibility: visible !important;
        line-height: 1.2 !important;
    }

    .carousel-caption h1 span {
        display: inline !important;
        visibility: visible !important;
    }

    .carousel-caption p {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
        margin-top: 0 !important;
        line-height: 1.3 !important;
        color: rgba(255, 255, 255, 0.95) !important;
        display: block !important;
        visibility: visible !important;
    }

    .carousel-cta-group {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        gap: 8px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .carousel-cta-btn {
        padding: 10px 18px !important;
        font-size: 0.8rem !important;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 !important;
    }

    .carousel-indicators {
        bottom: 15px;
        gap: 6px;
    }

    .carousel-indicators [data-bs-target] {
        width: 25px;
        height: 3px;
    }

    .carousel-indicators .active {
        width: 40px;
    }

    /* Hide stats on mobile to reduce clutter */
    .carousel-stats {
        display: none;
    }

    /* Adjust controls */
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .carousel-control-prev {
        left: 10px;
    }

    .carousel-control-next {
        right: 10px;
    }

    /* Reduce spacing between hero section and next section on mobile */
    /* .hero-section-full-height + .section-padding,
    .hero-section + .section-padding {
        padding-top: 30px !important;
    } */
}
