/* Style/hero.css */

html {
    scroll-behavior: auto; /* IMPORTANT: Disable smooth scrolling for GSAP's scroll animations to work correctly */
}

/* FIXED: Remove black background - use your brand colors instead */
body {
    background: linear-gradient(135deg, #1a0d4a, #2c1810); /* Your purple brand colors */
    /* This ensures when background fades, it fades to your brand colors, not black */
}

/* The hero section will act as the main container and trigger for the animation */
#hero-section {
    position: relative;
    height: 100vh;
    color: #FFFFFF;
    overflow: hidden;
}

/* This is the element that will be pinned */
.hero-pin-wrapper {
    position: relative;
    height: 100vh;
    width: 100%;
}

/* UPDATED: The background image container - VISIBLE AT START */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../IMG/Poster.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    /* Start partially visible to avoid black screen */
    opacity: 0.3;
    filter: brightness(0.7) blur(0px); /* Slightly dimmed for text readability but still visible */
    transition: filter 0.3s ease; /* Smooth transition when animation starts */
}

/* ADDED: Subtle overlay for text readability without hiding background */
.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(0, 0, 0, 0.2),  /* Light overlay at top */
        rgba(0, 0, 0, 0.4)   /* Slightly darker at bottom */
    );
    z-index: 1;
}

/* The main content that will be animated */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    text-align: center;
    z-index: 3; /* Above background and overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.2em;
    font-weight: 800;
    color: #FFFFFF;
    text-shadow: 0px 4px 20px rgba(0, 0, 0, 0.8); /* Stronger shadow for better readability */
    margin: 0;
    line-height: 1.2;
}

.hero-content .subheadline {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.95;
    margin: 15px 0 30px 0;
    text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.6);
}

.cta-button {
    display: inline-block;
    padding: 14px 32px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    color: #111;
    text-decoration: none;
    border-radius: 8px;
    background: #FFB14E;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* This will be our scroll down indicator */
.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    opacity: 0.8;
    z-index: 3;
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.5);
}

/* ADDED: Theme-aware adjustments */
body:not([data-theme="dark"]) {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

body:not([data-theme="dark"]) .hero-background {
    filter: brightness(0.8) blur(0px); /* Slightly brighter for light theme */
}

body:not([data-theme="dark"]) .hero-background::before {
    background: linear-gradient(
        rgba(255, 255, 255, 0.1),  /* Very light white overlay */
        rgba(0, 0, 0, 0.2)         /* Light dark overlay at bottom */
    );
}

body[data-theme="dark"] {
    background: linear-gradient(135deg, #1a0d4a, #2c1810);
}

body[data-theme="dark"] .hero-background {
    filter: brightness(0.7) blur(0px); /* Slightly dimmed for dark theme */
}

/* ADDED: Responsive adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5em;
        text-shadow: 0px 3px 15px rgba(0, 0, 0, 0.9);
    }
    
    .hero-content .subheadline {
        font-size: 1em;
    }
    
    .cta-button {
        padding: 12px 28px;
        font-size: 1em;
    }
    
    .hero-background {
        filter: brightness(0.6) blur(0px); /* Darker on mobile for better text readability */
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2em;
        text-shadow: 0px 2px 12px rgba(0, 0, 0, 1);
    }
    
    .hero-content {
        width: 95%;
    }
    
    .hero-background {
        filter: brightness(0.5) blur(0px); /* Even darker on small screens */
    }
}

/* ADDED: Loading state - ensures smooth appearance */
.hero-section.loading .hero-background {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-section.loaded .hero-background {
    opacity: 1;
}

/* MOBILE-SPECIFIC HERO CONTENT ADJUSTMENTS */
@media (max-width: 768px) {
    .hero-content {
        width: 95%; /* More width utilization */
        max-width: 600px; /* Smaller max-width for mobile */
        padding: 0 10px; /* Add padding for safety */
    }
    
    .hero-content h1 {
        font-size: 2.2em; /* Smaller base size for mobile */
        line-height: 1.1; /* Tighter line height */
        margin: 0 0 10px 0; /* Reduced margin */
        /* Ensure text stays visible during animation */
        max-height: 60vh; /* Prevent overflow */
        overflow: hidden;
        text-align: center;
    }
    
    .hero-content .subheadline {
        font-size: 1em; /* Smaller subheadline */
        margin: 10px 0 20px 0; /* Reduced margins */
        line-height: 1.3;
    }
    
    .cta-button {
        padding: 10px 24px; /* Smaller button */
        font-size: 0.95em;
        margin-top: 10px;
    }
    
    /* Ensure hero section doesn't cause horizontal scroll */
    #hero-section {
        overflow-x: hidden;
    }
    
    .hero-content {
        /* Prevent content from moving outside viewport */
        transform: translate(-50%, -50%);
        max-height: 80vh;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .hero-content {
        width: 98%; /* Maximum width utilization */
        max-width: 400px;
        padding: 0 5px;
    }
    
    .hero-content h1 {
        font-size: 1.8em; /* Even smaller for small phones */
        line-height: 1.1;
        margin: 0 0 8px 0;
        /* Critical: Prevent text from going off-screen */
        max-height: 50vh;
        overflow: hidden;
        word-wrap: break-word;
    }
    
    .hero-content .subheadline {
        font-size: 0.9em;
        margin: 8px 0 15px 0;
        line-height: 1.2;
    }
    
    .cta-button {
        padding: 8px 20px;
        font-size: 0.9em;
        margin-top: 8px;
    }
    
    /* Additional safety measures for small screens */
    .hero-content * {
        max-width: 100%;
        word-wrap: break-word;
    }
}

/* ANIMATION-SPECIFIC MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
    /* Ensure animated text stays within bounds */
    .hero-content h1 {
        /* Add constraints during animation */
        transition: transform 0.1s ease-out;
    }
    
    /* Prevent horizontal overflow during scaling */
    .hero-pin-wrapper {
        overflow-x: hidden;
    }
    
    /* Keep scroll indicator visible longer on mobile */
    .scroll-down-indicator {
        bottom: 20px;
        font-size: 0.8em;
    }
}

/* LANDSCAPE MOBILE ADJUSTMENTS */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-content h1 {
        font-size: 1.6em; /* Even smaller in landscape */
        max-height: 40vh; /* More restrictive height */
    }
    
    .hero-content .subheadline {
        font-size: 0.85em;
        margin: 5px 0 10px 0;
    }
    
    .cta-button {
        padding: 6px 18px;
        font-size: 0.85em;
    }
}
