/* 1. SETUP & THEME COLORS */
:root {
    --trail-green: #1b4332;
    --summit-orange: #bc6c25;
    --moss: #2d6a4f;
    --earth: #fefae0;
    --white: #ffffff;
    --text-dark: #081c15;
    --scout-grad: linear-gradient(135deg, #94a3b8, #64748b);
    --path-grad: linear-gradient(135deg, #a8e063, #56ab2f);
    --explorer-grad: linear-gradient(135deg, #00b4db, #0083b0);
    --trail-grad: linear-gradient(135deg, #f093fb, #f5576c);
    --guide-grad: linear-gradient(135deg, #4b6cb7, #182848);
    --legend-grad: linear-gradient(135deg, #f6d365, #fda085);
    --apex-grad: linear-gradient(135deg, #232526, #414345);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--earth);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Global Responsive Image Fix */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Modal Styles --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 3000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: var(--earth);
    margin: 50px auto; 
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin-bottom: 50px; 
}

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

.close-modal, .close-signup {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: var(--trail-green);
    font-weight: bold;
    line-height: 1;
    z-index: 10;
}

.close-modal:hover, .close-signup:hover {
    color: var(--summit-orange);
}

.modal-header h2 {
    color: var(--trail-green);
    margin-bottom: 10px;
    padding-right: 40px; 
}

.modal-info-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

/* Form Styles */
#hikeSignupForm input,
#hikeSignupForm textarea,
#joinClubForm input,
#joinClubForm textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: white;
}

#hikeSignupForm textarea,
#joinClubForm textarea {
    min-height: 100px;
    resize: vertical;
}

#hikeSignupForm input:focus,
#hikeSignupForm textarea:focus,
#joinClubForm input:focus,
#joinClubForm textarea:focus {
    outline: none;
    border-color: var(--summit-orange);
    box-shadow: 0 0 0 2px rgba(188, 108, 37, 0.1);
}

/* 2. NAVIGATION */
.navbar {
    background-color: var(--trail-green);
    position: sticky;
    top: 0; 
    z-index: 1000;
    width: 100%;
}

.nav-content {
    display: flex;
    justify-content: center; 
    align-items: center;
    position: relative;
    height: 70px;
}

.logo-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-text {
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: -1.5px;
    text-transform: uppercase;
    color: var(--earth);
    white-space: nowrap;
}

.logo-text span {
    color: var(--summit-orange);
}

.nav-logo-img {
    height: 38px;
    width: auto;
    border-radius: 4px;
}

.hamburger {
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    position: absolute;
    right: 20px;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--earth);
    margin: 6px 0;
    transition: 0.3s;
}

.nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--trail-green);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 1001;
    list-style: none;
}

.nav-links a {
    color: var(--earth);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-links a:hover {
    color: var(--summit-orange);
}

.btn-join {
    background-color: var(--summit-orange);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
}

.nav-toggle:checked ~ .nav-links {
    right: 0; 
}

.nav-toggle:checked ~ .hamburger span:nth-child(1) { transform: rotate(45deg) translate(6px, 7px); }
.nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .hamburger span:nth-child(3) { transform: rotate(-45deg) translate(6px, -7px); }

.nav-toggle {
    display: none;
}

/* 3. HERO SECTION */
.hero {
    height: 70vh;
    background: linear-gradient(rgba(27, 67, 50, 0.7), rgba(27, 67, 50, 0.7)), 
                url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 1rem;
    font-weight: 900;
}

.badge {
    background: var(--summit-orange);
    padding: 4px 12px;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 50px;
}

.cta-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 1.6rem;
    background: var(--white);
    color: var(--trail-green);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: transform 0.3s;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-5px);
}

/* 4. SECTION STYLES */
.section {
    padding: 80px 0;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--trail-green);
}

.line {
    width: 60px;
    height: 4px;
    background: var(--summit-orange);
    margin-top: 10px;
}

/* 5. HIKE CARDS */
.hike-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.hike-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 6. GALLERY & TRIP STORY */
.trip-story-div {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.trip-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.photo-caption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
    text-align: center;
}

.trip-main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.trip-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    background: var(--earth);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .trip-main-content {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: start;
    }
}

/* 7. FOOTER */
.footer {
    background: var(--trail-green);
    color: var(--earth);
    padding: 4rem 0;
    text-align: center;
    opacity: 0.95;
}

/* --- JOIN PAGE --- */
.join-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.community-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 600px;
}

.messenger-btn {
    background: #0084FF !important; 
    color: white !important;
    margin-top: 15px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    width: auto;
    display: inline-block;
    text-decoration: none;
    border-radius: 4px;
}

/* --- STATUS NOTES & INTERACTIVE --- */
.hike-status-note {
    background: #ffcc00;
    color: #333;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(0,0,0,0.1);
}

.pulse-dot {
    height: 8px;
    width: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

button:disabled {
    cursor: default;
    opacity: 0.7;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .logo-text {
        font-size: 1.4rem;
    }
    
    .nav-logo-img {
        height: 30px;
    }

    .section {
        padding: 50px 0;
    }

    .trip-stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 20px auto;
        padding: 20px;
    }
}


/* Achievement Card & Ranks */
#passport-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.rank-badge-card {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: center; /* Ensures the icon and text are centered */
}

/* Rank Specific Classes */
.rank-scout { background: var(--scout-grad); }
.rank-pathfinder { background: var(--path-grad); }
.rank-explorer { background: var(--explorer-grad); }
.rank-trailblazer { background: var(--trail-grad); }
.rank-guide { background: var(--guide-grad); }

.rank-legend { 
    background: var(--legend-grad); 
    border: 2px solid #ffca28; 
}

.rank-apex { 
    background: var(--apex-grad);
    border: 2px solid #ffd700;
    position: relative;
    overflow: hidden;
}

/* Added a subtle glow for the top rank */
.rank-apex::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    pointer-events: none;
}


.story-card {
    width: 1080px;  /* Instagram Story Width */
    height: 1920px; /* Instagram Story Height */
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 100px 60px;
    color: white;
    font-family: 'Inter', sans-serif; /* Use a bold, modern font */
}

.story-header {
    text-align: center;
}

.story-rank-icon {
    font-size: 200px;
    display: block;
    margin-bottom: 40px;
}

.story-level {
    font-size: 80px;
    font-weight: 900;
    letter-spacing: 5px;
    background: var(--legend-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.story-stats {
    border-top: 2px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding: 60px 0;
    text-align: center;
}

.stat-value {
    font-size: 140px;
    font-weight: 900;
    display: block;
}

.stat-label {
    font-size: 40px;
    color: #888;
    letter-spacing: 2px;
}


.share-btn {
    background: #0084FF;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    width: 100%;
    margin-top: 15px;
    transition: 0.3s;
}

.share-btn:hover {
    background: #0073e6;
    transform: translateY(-2px);
}



/* --- High-Quality 2D Parallax Scouting Loop --- */
.hike-animation-zone {
    width: 100%;
    height: 160px;
    background: linear-gradient(to bottom, #1a2c5b 0%, #4a5d91 50%, #92a8d1 100%); /* Deep twilight sky */
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.3);
}

/* Distant Mountains (Static) */
.hike-animation-zone::before {
    content: "🏔️";
    position: absolute;
    bottom: 20px;
    left: 20%;
    font-size: 80px;
    opacity: 0.3;
    filter: blur(2px);
}

/* Moving Forest Layer */
.forest-scroll {
    display: flex;
    width: 200%;
    position: absolute;
    bottom: 10px;
    animation: parallaxScroll 15s linear infinite;
    z-index: 2;
    z-index: 2;
}

.tree-group {
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 30px;
}

/* The Scouting Hiker */
.hiker-scout {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 45px;
    z-index: 10;
    animation: scoutLook 4s ease-in-out infinite;
    z-index: 10;
}

/* Ground Fog */
.mist {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, rgba(255,255,255,0.2));
    backdrop-filter: blur(2px);
    z-index: 5;
}

/* Keyframes for the 2D Loop */
@keyframes parallaxScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes scoutLook {
    0% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(-5deg) scale(1.05); }
    50% { transform: translateX(-50%) rotate(5deg) scale(1); }
    75% { content: "🔭"; } /* This won't work on a div, handled in HTML */
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* Passport Badges */
.passport-badge {
    background: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid var(--trail-green);
    color: var(--trail-green);
    box-shadow: 2px 2px 0px var(--trail-green);
    transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    margin: 4px;
}

.passport-badge:hover {
    transform: scale(1.1) rotate(2deg);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--summit-orange);
    border-color: var(--summit-orange);
    color: var(--summit-orange);
}

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