/* ============================================
   TANZANIA SAFARI PLANNER - STYLESHEET
   ============================================
   This CSS file controls all visual styling.
   
   Color Palette (Safari Theme):
   - Deep Green:    #1B4332 (primary brand)
   - Forest Green:  #2D6A4F (accents)
   - Dark Blue:     #0F2C2E (hero overlay/footer)
   - Gold:          #D4AF37 (highlights, hover)
   - Cream:         #FAF9F6 (page background)
   - White:         #FFFFFF (cards, text)
   
   Organization:
   1. CSS Variables & Reset
   2. Navigation Bar
   3. Hero Section
   4. Planner Form Card
   5. Footer
   6. Responsive (Mobile)
   ============================================ */


/* ============================================
   1. CSS VARIABLES & GLOBAL RESET
   ============================================ */

/* 
   :root defines CSS custom properties (variables).
   These can be reused throughout the stylesheet.
   Changing a variable here updates it everywhere.
*/
:root {
    --deep-green: #1B4332;      /* Primary dark green */
    --forest-green: #2D6A4F;    /* Lighter green for accents */
    --dark-blue: #0F2C2E;       /* Dark overlay/footer background */
    --gold: #D4AF37;            /* Gold for highlights and hover */
    --gold-light: #F4E4A6;      /* Light gold for backgrounds */
    --cream: #FAF9F6;           /* Warm off-white page background */
    --white: #FFFFFF;           /* Pure white */
    --text-dark: #1A1A1A;       /* Near-black for headings */
    --text-muted: #6B7280;      /* Gray for secondary text */
    
    /* Shadow presets for depth */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.12);
    
    /* Reusable transition for smooth animations */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 
   Universal reset removes default browser margins/padding.
   'box-sizing: border-box' makes width/height include padding.
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling when clicking anchor links */
html {
    scroll-behavior: smooth;
}

/* Base body styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}


/* ============================================
   2. NAVIGATION BAR
   ============================================
   - Fixed at top (position: fixed)
   - Transparent initially, solid on scroll
   - Logo on left, links on right
   ============================================ */

.navbar {
    position: fixed;        /* Stays at top when scrolling */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;          /* Ensures navbar stays above other content */
    padding: 1.2rem 5%;     /* Vertical and horizontal spacing */
    display: flex;          /* Flexbox for horizontal layout */
    justify-content: space-between; /* Logo left, links right */
    align-items: center;
    transition: var(--transition); /* Smooth background change */
}

/* 
   When user scrolls down, JS adds 'scrolled' class.
   This changes navbar from transparent to solid white.
*/
.navbar.scrolled {
    background-color: var(--white);
    box-shadow: var(--shadow-soft);
    padding: 0.8rem 5%;     /* Slightly smaller padding when solid */
}

/* Logo styling */
.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);    /* White on transparent navbar */
    text-decoration: none;  /* Remove underline */
    letter-spacing: 0.5px;
    transition: var(--transition);
}

/* Logo color changes to green when navbar is solid */
.navbar.scrolled .logo {
    color: var(--deep-green);
}

/* Navigation links container */
.nav-links {
    display: flex;
    list-style: none;       /* Remove bullet points */
    gap: 2.5rem;            /* Space between links */
}

/* Individual navigation link styling */
.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;     /* Needed for underline animation */
    transition: var(--transition);
}

/* Link color changes when navbar is solid */
.navbar.scrolled .nav-links a {
    color: var(--text-dark);
}

/* 
   Animated underline on hover.
   ::after creates a pseudo-element after the link text.
*/
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;               /* Starts invisible (width 0) */
    height: 2px;
    background-color: var(--gold);
    transition: var(--transition);
}

/* On hover, underline expands to full width */
.nav-links a:hover::after {
    width: 100%;
}

/* Text color changes to gold on hover */
.nav-links a:hover {
    color: var(--gold);
}

/* Mobile menu button (hidden on desktop) */
.mobile-menu-btn {
    display: none;          /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
    font-size: 1.5rem;
}

/* Mobile button color changes with navbar */
.navbar.scrolled .mobile-menu-btn {
    color: var(--deep-green);
}


/* ============================================
   3. HERO SECTION
   ============================================
   - Full viewport height (100vh)
   - Background image with dark overlay
   - Centered text with fade-in animation
   ============================================ */

.hero {
    position: relative;
    height: 100vh;          /* Full screen height */
    min-height: 700px;      /* Minimum height for small screens */
    display: flex;
    align-items: center;    /* Vertical centering */
    justify-content: center;/* Horizontal centering */
    text-align: center;
    overflow: hidden;       /* Prevents image overflow */
}

/* Background image layer */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Unsplash image of Tanzania safari/Serengeti wildlife */
    background-image: url('https://images.unsplash.com/photo-1516426122078-c23e76319801?q=80&w=2068&auto=format&fit=crop');
    background-size: cover;     /* Cover entire area */
    background-position: center;/* Center the image */
    background-repeat: no-repeat;
    transform: scale(1.05);     /* Slightly zoomed for animation */
    /* Slow zoom animation creates a "Ken Burns" effect */
    animation: slowZoom 20s ease-in-out infinite alternate;
}

/* Keyframes for slow background zoom */
@keyframes slowZoom {
    from { transform: scale(1.05); }
    to   { transform: scale(1.15); }
}

/* Dark gradient overlay for text readability */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient: darker at top and bottom, lighter in middle */
    background: linear-gradient(
        to bottom,
        rgba(15, 44, 46, 0.7) 0%,
        rgba(15, 44, 46, 0.5) 50%,
        rgba(15, 44, 46, 0.8) 100%
    );
}

/* Text content sits above background and overlay */
.hero-content {
    position: relative;
    z-index: 2;             /* Higher z-index = on top */
    max-width: 800px;
    padding: 0 2rem;
}

/* Small gold subtitle above main heading */
.hero-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    /* Animation: fade in and slide up */
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.3s; /* 0.3s delay */
}

/* Main heading */
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem); /* Responsive font size */
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.5s; /* 0.5s delay */
}

/* Description paragraph */
.hero-text {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 0.7s; /* 0.7s delay */
}

/* Scroll-down indicator at bottom of hero */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.2s;
}

.scroll-indicator span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Animated vertical line */
.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* Keyframe animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50%      { opacity: 1;   transform: scaleY(1);   }
}


/* ============================================
   4. SAFARI PLANNER FORM
   ============================================
   - Centered white card with rounded corners
   - Contains all form inputs
   - Shadow creates floating effect
   ============================================ */

.planner-section {
    position: relative;
    padding: 6rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Main form card */
.planner-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    /* Initial state for scroll animation (JS adds 'visible' class) */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Class added by JS when card scrolls into view */
.planner-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Decorative colored line at top of card */
.planner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--deep-green), var(--gold), var(--deep-green));
}

/* Card header */
.planner-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.planner-header h2 {
    font-size: 2rem;
    color: var(--deep-green);
    margin-bottom: 0.5rem;
}

.planner-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Each form field wrapper */
.form-group {
    margin-bottom: 1.75rem;
}

/* Label above each input */
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
}

/* Red asterisk for required fields */
.form-label .required {
    color: var(--gold);
}

/* Text and date inputs */
.form-input,
.form-select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #E5E7EB;  /* Light gray border */
    border-radius: 12px;
    font-family: inherit;        /* Use body's font */
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: var(--white);
    transition: var(--transition);
    outline: none;               /* Remove default blue outline */
}

/* Focus state: border turns green + soft glow */
.form-input:focus,
.form-select:focus {
    border-color: var(--forest-green);
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
}

/* Select dropdown styling */
.form-select {
    cursor: pointer;
    appearance: none;            /* Remove default browser arrow */
    /* Custom dropdown arrow using SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

/* Helper text under form fields */
.form-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Budget slider container */
.range-container {
    margin-top: 0.5rem;
}

/* Row showing min, current, and max budget */
.range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* Min and max labels */
.range-min,
.range-max {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Dynamic value display (e.g., "$2,650") */
.range-value {
    font-weight: 700;
    color: var(--deep-green);
    font-size: 1.1rem;
    background: var(--gold-light);
    padding: 0.3rem 0.9rem;
    border-radius: 8px;
}

/* 
   RANGE SLIDER CUSTOM STYLING
   -webkit- and -moz- prefixes target specific browsers
*/
input[type="range"] {
    -webkit-appearance: none;    /* Remove default slider */
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--forest-green), var(--gold));
    outline: none;
    cursor: pointer;
}

/* Slider thumb (the draggable circle) - Chrome/Safari/Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

/* Enlarge thumb on hover */
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Slider thumb - Firefox */
input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--deep-green), var(--forest-green));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;            /* Hides shine effect overflow */
    margin-top: 0.5rem;
}

/* Shine sweep animation on hover */
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

/* Move shine across on hover */
.submit-btn:hover::before {
    left: 100%;
}

/* Lift button slightly on hover */
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(27, 67, 50, 0.3);
}

/* Press down effect on click */
.submit-btn:active {
    transform: translateY(0);
}


/* ============================================
   5. FOOTER
   ============================================ */

.footer {
    background-color: var(--dark-blue);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2.5rem 1.5rem;
    font-size: 0.9rem;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}


/* ============================================
   6. RESPONSIVE DESIGN (MOBILE)
   ============================================
   These styles apply when screen is 768px or narrower.
   Uses CSS Media Queries.
   ============================================ */

@media (max-width: 768px) {
    .nav-links {
        display: flex;
        position: absolute;
        top: 70px;
        right: 5%;
        background: var(--white);
        flex-direction: column;
        width: 220px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        padding: 15px;
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .mobile-menu-btn {
        display: block;
    }
    
    /* Smaller hero text */
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    /* Reduce card padding */
    .planner-card {
        padding: 2rem 1.5rem;
    }
    
    .planner-header h2 {
        font-size: 1.6rem;
    }
}

/* Even smaller screens (phones) */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem 4%;
    }
    
    .planner-section {
        padding: 4rem 1rem;
    }
    
    .planner-card {
        padding: 1.75rem 1.25rem;
        border-radius: 18px;
    }
}