:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-main: #ffffff;
    --bg-alt: #f9fafb;
    --bg-dark: #111827;
    --container-max: 1200px;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-main);
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 100px 0;
}

.section-center {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-center h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.alternate-bg {
    background-color: var(--bg-alt);
}

.dark-bg {
    background-color: var(--bg-dark);
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: var(--transition);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background-color: var(--bg-alt);
    border-color: #d1d5db;
}

.btn-full {
    width: 100%;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
}

.link-arrow:hover svg {
    transform: translateX(4px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: var(--transition);
}

.header.sticky .mobile-menu-toggle span {
    background-color: var(--text-main);
}

.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

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

/* Header & Nav */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
}

.header.sticky {
    position: fixed;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a:not(.btn) {
    font-weight: 500;
    color: var(--text-main);
}

.header:not(.sticky) .nav-links a:not(.btn) {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header:not(.sticky) .logo {
    color: white;
}

.nav-links a:not(.btn):hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    position: relative;
    height: 90vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.2)), url('assets/hero.png');
    background-size: cover;
    background-position: center;
    z-index: -1;
    transform: scale(1.05);
    animation: zoomOut 10s ease-out infinite alternate;
}

@keyframes zoomOut {
    from { transform: scale(1.1); }
    to { transform: scale(1); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.hero-left h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-left p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    backdrop-filter: blur(4px);
    color: var(--primary-light);
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.live-map-preview {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.map-placeholder {
    aspect-ratio: 4/3;
    background: #e5e7eb url('https://tiles.stadiamaps.com/tiles/alidade_smooth/12/655/1582.png?api_key=PLACEHOLDER') center/cover;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.map-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.1));
}

.map-ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
}

.map-location {
    background: white;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow);
}

.map-pins .pin {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: var(--shadow);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: rotate(-45deg) translateY(0); }
    50% { transform: rotate(-45deg) translateY(-10px); }
}

/* Search Strip */
.search-strip-wrapper {
    position: sticky;
    top: 80px;
    z-index: 100;
    margin-top: -50px;
}

.search-strip {
    background: white;
    border-radius: 100px;
    padding: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.15);
    gap: 15px;
    border: 1px solid #f3f4f6;
}

.search-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
}

.search-input-group input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: var(--text-main);
}

.filters {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 10px;
}

.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-alt);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--primary-light);
    padding: 8px 16px;
    border-radius: 100px;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.toggle-switch input { display: none; }

.slider {
    width: 34px;
    height: 18px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: .3s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); }

/* Value Prop */
.prop-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    transition: var(--transition);
}

.prop-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.prop-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

.prop-card h3 {
    margin-bottom: 12px;
}

.prop-card p {
    color: var(--text-muted);
}

/* Trail Cards */
.trail-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    transition: var(--transition);
}

.trail-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.trail-card-map {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}

.tag-verified { background: var(--primary-light); color: var(--primary-dark); }
.tag-needs-data { background: #fee2e2; color: #ef4444; }
.tag-ai { background: #e0f2fe; color: #0ea5e9; }

.trail-card-content {
    padding: 24px;
}

.trail-loc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.trail-stats {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.diff-easy { color: var(--primary); }
.diff-med { color: var(--accent); }
.diff-hard { color: #ef4444; }

.trail-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stars { color: #fbbf24; }
.reviews { font-size: 0.8rem; color: var(--text-muted); }

/* AI Generator */
.ai-generator .split-text { padding-right: 40px; }

.ai-form {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.form-group { margin-bottom: 25px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 15px; }

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.radio-chips { display: flex; gap: 10px; }
.radio-chips input { display: none; }
.radio-chips label {
    padding: 8px 16px;
    background: var(--bg-alt);
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.radio-chips input:checked + label {
    background: var(--primary);
    color: white;
}

.ai-map-container {
    background: white;
    border-radius: 24px;
    height: 400px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.ai-map-base {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, #f3f4f6 0%, #e5e7eb 100%);
}

/* Steps Item */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.step-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 20px;
}

.gamification {
    text-align: center;
    background: var(--primary-light);
    padding: 40px;
    border-radius: 24px;
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.gamified-badge {
    font-size: 2.5rem;
    background: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

/* App Section */
.phone-mockup {
    background: #2d3748;
    width: 300px;
    height: 600px;
    margin: 0 auto;
    border-radius: 40px;
    padding: 15px;
    border: 8px solid #4a5568;
    position: relative;
}

.phone-screen {
    background: white;
    height: 100%;
    border-radius: 25px;
    overflow: hidden;
}

.app-interface {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-map { flex: 1; background: #cbd5e0; }

.app-stats {
    padding: 20px;
    display: flex;
    justify-content: space-around;
    background: white;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}

.app-stats span { display: block; font-size: 0.7rem; color: var(--text-muted); }
.app-stats strong { font-size: 1.1rem; }

.feature-list { margin: 30px 0; }
.feature-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-list li::before {
    content: "✓";
    color: var(--primary);
    font-weight: 900;
}

.app-buttons { display: flex; gap: 15px; }

.btn-app-store, .btn-google-play {
    background: #000;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #333;
}

/* Partner Logos */
.logos-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
    opacity: 0.6;
}

.partner-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--bg-alt);
    padding: 80px 0 40px;
    border-top: 1px solid #e5e7eb;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand .logo { margin-bottom: 20px; color: var(--text-main); }
.footer-brand p { color: var(--text-muted); max-width: 300px; }

.footer-nav h4 { margin-bottom: 24px; font-size: 1rem; }
.footer-nav ul li { margin-bottom: 12px; }
.footer-nav ul a { color: var(--text-muted); font-size: 0.9rem; }
.footer-nav ul a:hover { color: var(--primary); }

/* Footer Bottom (Existing) */
.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Trail Detail Page Specific Styles */
.trail-hero {
    height: 60vh;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: white;
    padding-bottom: 60px;
    overflow: hidden;
}

.trail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    z-index: 1;
}

.trail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: transform 0.5s ease;
}

.trail-hero:hover .trail-hero-bg {
    transform: scale(1.02);
}

.trail-hero-content {
    position: relative;
    z-index: 2;
}

.trail-hero-content h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 12px;
}

.trail-hero-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
}

.trail-stats-bar {
    background: white;
    box-shadow: var(--shadow);
    padding: 30px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 60px;
}

.stats-container {
    display: flex;
    justify-content: flex-start;
    gap: 60px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.trail-main-content {
    margin-bottom: 100px;
}

.trail-content-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 60px;
}

.content-section {
    margin-bottom: 50px;
}

.content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 24px;
}

.content-section p {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

/* Photos Grid */
.photo-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Activity Feed */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.activity-card {
    padding: 24px;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
}

.user-name {
    font-weight: 600;
}

.activity-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 24px;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-mini-v2 {
    height: 300px;
    background: #eef2f3;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.condition-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #dcfce7;
    color: #166534;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 992px) {
    .trail-content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        gap: 30px;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .stat-item {
        min-width: 120px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .split-layout { gap: 40px; }
}

@media (max-width: 768px) {
    .split-layout, .grid-3 { grid-template-columns: 1fr; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-right { display: none; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        padding: 40px;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a:not(.btn) {
        color: var(--text-main) !important;
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }

    .search-strip-wrapper {
        top: 20px;
        margin-top: 0;
        padding: 0 1rem;
    }

    .search-strip {
        flex-direction: column;
        border-radius: 24px;
        padding: 16px;
    }

    .filters {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .section-padding { padding: 60px 0; }
    .section-center h2 { font-size: 2rem; }
}

@media (max-width: 480px) {
    .steps-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* Custom Minimalist Map Attribution Styling (Transparent, bottom-left) */
.custom-map-attribution-clean {
    background: transparent !important;
    margin: 0 10px 10px 10px !important;
    font-size: 10px !important;
    font-family: 'Inter', sans-serif !important;
    color: #4b5563 !important; /* Ddarker grey */
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.custom-map-attribution-clean:hover {
    opacity: 1;
}

.custom-map-attribution-clean a {
    color: inherit !important;
    text-decoration: none !important;
}

.custom-map-attribution-clean a:hover {
    text-decoration: underline !important;
}

/* Ensure no shadows or backgrounds spill over */
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: var(--shadow) !important; }
