/**
 * ==============================================
 * HERO CAROUSEL STYLES - Al Ikhsan Beji
 * ==============================================
 * 
 * Layout: Text on LEFT, Image on RIGHT
 * Background: WHITE with soft pulsing green circles
 * 
 * Features:
 * - White background with decorative green circles
 * - Multi-slide carousel with auto-rotation
 * - Image card with rounded corners
 * - Circular navigation arrows attached to card
 * - Text slide-from-top + fade animations
 * - Image fade in/out animations
 */

/* =========================
   Hero Container
   ========================= */
.hero-carousel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    /* Pull hero up behind navbar */
    margin-top: -64px;
    /* Add padding: navbar height + base padding + extra 50px */
    padding: calc(64px + 2rem + 50px) 2rem 4rem;
    /* WHITE background */
    background: #ffffff;
}

/* =========================
   Decorative Green Circles
   - Top-right corner
   - Bottom-left corner
   - Soft blur, low opacity
   - Gentle pulse animation
   ========================= */
.hero-decor {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    /* Soft, feathered appearance using gradient */
    filter: blur(60px);
}

/* Top-right circle */
.hero-decor-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
    background: radial-gradient(circle,
            rgba(134, 239, 172, 0.58) 0%,
            rgba(74, 222, 128, 0.32) 40%,
            rgba(34, 197, 94, 0.14) 70%,
            transparent 100%);
    animation: pulseCircle 6s ease-in-out infinite;
}

/* Bottom-left circle */
.hero-decor-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -150px;
    background: radial-gradient(circle,
            rgba(167, 243, 208, 0.52) 0%,
            rgba(110, 231, 183, 0.3) 40%,
            rgba(52, 211, 153, 0.14) 70%,
            transparent 100%);
    animation: pulseCircle 7s ease-in-out infinite;
    animation-delay: 1s;
}

/* Gentle pulse animation */
@keyframes pulseCircle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.82;
        transform: scale(1.06);
    }
}

/* =========================
   Hero Wrapper (Main Layout)
   ========================= */
.hero-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    /* Align text and image at the same level */
    align-items: center;
}

/* =========================
   LEFT: Text Content Area
   ========================= */
.hero-text-area {
    position: relative;
    min-height: 380px;
    /* Reserve vertical space so CTA stays locked even if description is removed */
    --hero-cta-lock-space: 7.5rem;
}

/* Individual slide text containers */
.hero-slide-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(-30px);
    pointer-events: none;
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid;
    grid-template-rows: auto auto var(--hero-cta-lock-space) auto;
}

/* Active slide text - visible and interactive */
.hero-slide-text--active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Arabic Tagline */
.hero-arabic-text {
    font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    color: #046e50;
    margin-bottom: 0.75rem;
    direction: rtl;
    unicode-bidi: plaintext;
    /* Tetap RTL, tapi posisikan teks di sisi kiri (seperti desain sebelumnya) */
    text-align: left;
}

/* Main Headline */
.hero-title {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #111827;
}

.hero-title-highlight {
    background: linear-gradient(135deg, #046e50 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.hero-desc {
    font-size: clamp(0.9375rem, 2vw, 1.0625rem);
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 1.75rem;
    max-width: 520px;
}

/* CTA Button Group */
.hero-cta-group {
    /* Always place CTA in the last row so it doesn't move up when the description is removed */
    grid-row: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* CTA Buttons - Base */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.hero-cta i {
    font-size: 1rem;
}

/* Primary Button - Green solid */
.hero-cta-primary {
    background: linear-gradient(135deg, #046e50 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(4, 110, 80, 0.35);
}

.hero-cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(4, 110, 80, 0.45);
}

/* Secondary Button - Outline */
.hero-cta-secondary {
    background: transparent;
    color: #046e50;
    border: 2px solid #046e50;
    box-shadow: none;
}

.hero-cta-secondary:hover {
    background: #046e50;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(4, 110, 80, 0.3);
}

/* =========================
   RIGHT: Image Card Area
   ========================= */
.hero-image-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Raised 15px higher */
    margin-top: 55px;
    align-self: center;
}

/* 
   Image Card Container
   - Green rounded card as backdrop (LANDSCAPE)
   - PNG student image positioned at bottom center
   - overflow: visible allows image to extend outside
*/
.hero-image-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    /* Landscape ratio */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* Contain images within card boundaries */
    overflow: hidden;
    border-radius: 24px;
}

/* Cropping wrapper - constrained to card size */
.hero-image-cropper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    --scale-adjust: 0;
    box-shadow: none;
}

/* Green rounded backdrop card - HIDDEN for transparent images */
.hero-image-bg {
    display: none;
}

/* 
   Slide Images Container
   - Positioned to allow PNG to extend beyond card
   - Bottom aligned with slight extension
*/
.hero-slide-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.hero-slide-image--active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* 
   PNG Student Image Styling
   - Positioned at center of container
   - Maintains natural proportions (contain)
   - No shadow for clean look
*/
.hero-slide-image img {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    transform-origin: 50% 50%;
    transform: translateX(-50%);
    border-radius: 24px;
}

/* =========================
   Navigation Arrows
   ========================= */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #046e50;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.hero-arrow:hover {
    background: #046e50;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 25px rgba(4, 110, 80, 0.4);
}

.hero-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* Arrow positioning - attached to card edges */
.hero-arrow-prev {
    left: -26px;
}

.hero-arrow-next {
    right: -26px;
}

/* =========================
   Slider Dots
   ========================= */
.hero-dots {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(4, 110, 80, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-dot:hover {
    background: rgba(4, 110, 80, 0.4);
    transform: scale(1.15);
}

.hero-dot--active {
    background: #046e50;
    width: 36px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(4, 110, 80, 0.4);
}

/* =========================
   Wave Divider
   ========================= */
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    z-index: 5;
    line-height: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================
   Initial Animation States
   (for IntersectionObserver)
   ========================= */
.hero-carousel.hero-not-visible .hero-slide-text--active {
    opacity: 0;
    transform: translateY(-30px);
}

.hero-carousel.hero-not-visible .hero-slide-image--active {
    opacity: 0;
    transform: scale(1.1);
}

.hero-carousel.hero-not-visible .hero-arrow,
.hero-carousel.hero-not-visible .hero-dots {
    opacity: 0;
}

/* Transition when hero becomes visible */
.hero-carousel.hero-visible .hero-arrow {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.4s;
}

.hero-carousel.hero-visible .hero-dots {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================
   Responsive Adjustments
   ========================= */

/* =========================
   Responsive: Tablet (1024px and below)
   ========================= */
@media (max-width: 1024px) {
    .hero-carousel {
        /* On tablet/mobile, don't pull hero behind navbar */
        margin-top: 0;
        padding: 1.75rem 1.5rem 3.5rem;
    }

    .hero-wrapper {
        gap: 2rem;
    }

    .hero-image-card {
        max-width: 400px;
        aspect-ratio: 16 / 9;
    }

    .hero-image-cropper {
        --scale-adjust: -0.15;
    }

    .hero-arrow {
        width: 46px;
        height: 46px;
    }

    .hero-arrow-prev {
        left: -23px;
    }

    .hero-arrow-next {
        right: -23px;
    }

    .hero-decor-1 {
        width: 450px;
        height: 450px;
    }

    .hero-decor-2 {
        width: 350px;
        height: 350px;
    }
}

/* =========================
   Responsive: Mobile (768px and below)
   Layout: Stacked (Image on top, text below)
   ========================= */
@media (max-width: 768px) {
    .hero-carousel {
        min-height: auto;
        /* Ensure hero content starts 20px below navbar */
        margin-top: 0;
        padding: 20px 1rem 6rem;
        /* Increased bottom padding for wave */
    }

    .hero-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        /* More breathing room */
        text-align: center;
    }

    /* Image Area - First on mobile */
    .hero-image-area {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 0;
    }

    /* Text Area */
    .hero-text-area {
        width: 100%;
        min-height: auto;
        padding: 0 0.5rem;
        --hero-cta-lock-space: 6rem;
    }

    /* Force only active slide to show */
    .hero-slide-text {
        position: relative;
        display: none !important;
        transform: none;
        opacity: 0;
    }

    .hero-slide-text--active {
        display: grid !important;
        opacity: 1;
    }

    /* Arabic text */
    .hero-arabic-text {
        text-align: center;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        color: #059669;
        /* Brighter green */
    }

    /* Title - BIGGER & BOLDER */
    .hero-title {
        font-size: 2rem;
        /* Increased from 1.5rem */
        line-height: 1.2;
        margin-bottom: 1rem;
        letter-spacing: -0.02em;
    }

    .hero-title br {
        display: none;
    }

    /* Description */
    .hero-desc {
        max-width: 100%;
        font-size: 1rem;
        /* Increased from 0.9rem */
        line-height: 1.6;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
        color: #4b5563;
    }

    /* CTA Buttons - Stack vertically on mobile */
    .hero-cta-group {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }

    .hero-cta {
        width: 100%;
        max-width: 100%;
        /* Full width buttons */
        justify-content: center;
        padding: 1rem 1.5rem;
        /* Chunkier touch target */
        font-size: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        /* Subtle shadow */
    }

    .hero-cta:active {
        transform: scale(0.98);
    }

    /* Image card on mobile - LANDSCAPE */
    .hero-image-card {
        width: 100%;
        max-width: 350px;
        /* Wider image */
        aspect-ratio: 16 / 9;
        margin: 0 auto;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        /* More depth */
    }

    .hero-image-bg {
        border-radius: inherit;
    }

    .hero-image-cropper {
        border-radius: 20px;
        --scale-adjust: -0.25;
        /* Fill area when portrait image uses object-fit: contain */
        background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    }

    .hero-slide-image img {
        /* Avoid cropping uploaded portrait images on mobile */
        object-fit: contain;
        object-position: 50% 50%;
        padding: 0.25rem;
    }

    /* Navigation arrows - positioned inside card area */
    .hero-arrow {
        width: 40px;
        /* Slightly larger */
        height: 40px;
        font-size: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
    }

    .hero-arrow-prev {
        left: -12px;
        /* Pull closer */
    }

    .hero-arrow-next {
        right: -12px;
    }

    /* Slider dots - hide on mobile */
    .hero-dots {
        display: none !important;
    }

    /* Decorative circles - larger for mobile visibility */
    .hero-decor-1 {
        width: 300px;
        height: 300px;
        top: -100px;
        right: -100px;
        filter: blur(50px);
        opacity: 0.55;
    }

    .hero-decor-2 {
        width: 260px;
        height: 260px;
        bottom: -80px;
        left: -80px;
        filter: blur(50px);
        opacity: 0.5;
    }

    /* Wave */
    .hero-wave svg {
        height: 60px;
        /* Taller wave */
    }
}

/* =========================
   Responsive: Small Mobile (480px and below)
   iPhone SE, older phones
   ========================= */
@media (max-width: 480px) {
    .hero-carousel {
        /* Keep the 20px gap under navbar on small screens too */
        margin-top: 0;
        padding: 20px 0.75rem 2.5rem;
    }

    .hero-wrapper {
        gap: 1.25rem;
    }

    .hero-text-area {
        padding: 0;
        --hero-cta-lock-space: 4.75rem;
    }

    .hero-arabic-text {
        font-size: 1rem;
    }

    .hero-title {
        font-size: 1.25rem;
        line-height: 1.4;
        margin-bottom: 0.625rem;
    }

    .hero-desc {
        font-size: 0.85rem;
        line-height: 1.55;
        margin-bottom: 1rem;
    }

    .hero-image-card {
        max-width: 280px;
        aspect-ratio: 16 / 9;
    }

    .hero-image-bg {
        border-radius: inherit;
    }

    .hero-image-cropper {
        border-radius: 16px;
        --scale-adjust: -0.25;
        background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    }

    .hero-slide-image img {
        /* Keep full image visible on very small screens */
        object-fit: contain;
        object-position: 50% 50%;
        padding: 0.2rem;
    }

    .hero-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .hero-arrow-prev {
        left: -16px;
    }

    .hero-arrow-next {
        right: -16px;
    }

    .hero-cta {
        max-width: 260px;
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .hero-dots {
        margin-top: 1rem;
    }

    .hero-dot {
        width: 6px;
        height: 6px;
    }

    .hero-dot--active {
        width: 20px;
    }

    /* Decorative circles - still visible on small screens */
    .hero-decor-1 {
        width: 220px;
        height: 220px;
        top: -60px;
        right: -60px;
        filter: blur(35px);
        opacity: 0.45;
    }

    .hero-decor-2 {
        width: 180px;
        height: 180px;
        bottom: -50px;
        left: -50px;
        filter: blur(35px);
        opacity: 0.4;
    }

    .hero-wave svg {
        height: 40px;
    }
}

/* =========================
   Accessibility: Reduced Motion
   ========================= */
@media (prefers-reduced-motion: reduce) {

    .hero-slide-text,
    .hero-slide-image,
    .hero-arrow,
    .hero-dot,
    .hero-cta {
        transition: none;
    }

    .hero-slide-text {
        transform: none;
    }

    .hero-slide-image {
        transform: none;
    }

    .hero-decor {
        animation: none;
    }

    .hero-carousel.hero-visible .hero-arrow,
    .hero-carousel.hero-visible .hero-dots {
        animation: none;
        opacity: 1;
    }
}
