/* Big Lap - Shared Styles */
/* Mobile-first design */

/* Hide reCAPTCHA badge (attribution in footer per Google's terms) */
.grecaptcha-badge { visibility: hidden !important; }

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

:root {
    --primary: #1A4B6E;
    --primary-dark: #0F3654;
    --accent: #00B4A0;
    --accent-light: #00D4BC;
    --bg: #FFFFFF;
    --bg-alt: #F8F9FA;
    --text: #1F2937;
    --text-muted: #6B7280;
    --bottom-nav-height: 64px;
    --header-height: 56px;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--bottom-nav-height);
}

/* MapLibre: allow popups to extend beyond map container boundary */
.maplibregl-map { overflow: visible !important; }
.maplibregl-popup { z-index: 50 !important; }

/* ========== HEADER ========== */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo svg {
    width: 28px;
    height: 28px;
}

/* Desktop nav - hidden on mobile */
.desktop-nav {
    display: none;
    gap: 1.5rem;
}

.desktop-nav a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.desktop-nav a:hover {
    opacity: 1;
}

.desktop-nav .nav-login {
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.desktop-nav .nav-login:hover {
    background: rgba(255,255,255,0.25);
}

.desktop-nav .nav-add-photo {
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.desktop-nav .nav-add-photo:hover {
    background: var(--accent-light);
}

/* ========== BOTTOM NAV (Mobile) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.5rem;
    min-width: 64px;
    transition: color 0.2s;
}

.bottom-nav a svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.bottom-nav a.active {
    color: var(--accent);
}

.bottom-nav a:hover {
    color: var(--accent);
}

/* FAB - Add button */
.bottom-nav .fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 50%;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(0,180,160,0.35);
    color: white;
}

.bottom-nav .fab svg {
    width: 28px;
    height: 28px;
    margin-bottom: 0;
}

.bottom-nav .fab span {
    display: none;
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
}

/* ========== FOOTER ========== */
footer {
    background: var(--primary-dark);
    color: #FFFFFF;
    padding: 2rem;
    text-align: center;
    margin-bottom: var(--bottom-nav-height);
}

footer a {
    color: var(--accent-light);
}

footer p {
    margin: 0.25rem 0;
}

/* ========== CONTENT PAGES (Privacy, Terms) ========== */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.content-page h1 {
    color: var(--primary);
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.content-page .last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.content-page h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-page p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-page ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-page li {
    margin-bottom: 0.4rem;
}

.content-page a {
    color: var(--accent);
}

.highlight-box {
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    margin: 1.25rem 0;
    border-radius: 0 8px 8px 0;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1.25rem 0;
    border-radius: 0 8px 8px 0;
}

/* ========== HOME PAGE ========== */
.hero {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
    padding: 3rem 1.5rem 4.5rem;
    text-align: center;
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0,50 Q150,0 300,50 T600,50 T900,50 T1200,50 L1200,100 L0,100 Z' fill='%23FFFFFF'/%3E%3C/svg%3E");
    background-size: cover;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: #FFFFFF;
    color: var(--primary);
    padding: 0.875rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.features {
    padding: 2.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.feature-card svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.map-section {
    background: var(--primary-dark);
    color: #FFFFFF;
    padding: 2.5rem 1rem;
    text-align: center;
}

.map-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.map-section > p {
    font-size: 0.9rem;
    opacity: 0.9;
}

#map {
    position: relative;
    max-width: 1000px;
    margin: 1.5rem auto;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.map-legend {
    position: absolute;
    bottom: 28px;
    right: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #333;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.map-legend-item:last-child {
    margin-bottom: 0;
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.map-legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 0.5px rgba(0,0,0,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 8px;
    font-weight: bold;
    line-height: 1;
}

.maplibregl-ctrl-attrib {
    font-size: 10px;
}

/* ========== DESKTOP STYLES ========== */
@media (min-width: 769px) {
    body {
        padding-bottom: 0;
    }

    header {
        padding: 1rem 2rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo svg {
        width: 32px;
        height: 32px;
    }

    .desktop-nav {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    footer {
        margin-bottom: 0;
    }

    /* Content pages */
    .content-page {
        padding: 3rem 2rem;
    }

    .content-page h1 {
        font-size: 2.5rem;
    }

    .content-page h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    /* Home page */
    .hero {
        padding: 4rem 2rem;
    }

    .hero::before {
        height: 100px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.25rem;
        max-width: 600px;
    }

    .features {
        padding: 4rem 2rem;
    }

    .features h2 {
        font-size: 2rem;
        margin-bottom: 3rem;
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .feature-card {
        padding: 2rem;
    }

    .feature-card svg {
        width: 64px;
        height: 64px;
    }

    .map-section {
        padding: 4rem 2rem;
    }

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

    #map {
        height: 500px;
        margin: 2rem auto;
    }
}

/* ========== ADD PHOTO ACTION SHEET ========== */
.add-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.add-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.add-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-sheet.show {
    transform: translateY(0);
}

.add-sheet-content {
    background: var(--bg);
    border-radius: 16px 16px 0 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.add-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    border: none;
    background: var(--bg-alt);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.add-option:hover {
    background: #e9ecef;
}

.add-option:last-child {
    margin-bottom: 0;
}

.add-option svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.add-option-cancel {
    background: transparent;
    justify-content: center;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.add-option-cancel:hover {
    background: var(--bg-alt);
}

/* ========== MARKER VIEW PAGE ========== */
.share-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
}

.share-btn:hover {
    background: var(--accent-light);
}

.trip-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 0.9;
}

.trip-link:hover {
    opacity: 1;
}

.marker-info {
    padding: 1.5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.marker-info h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.marker-notes {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.marker-meta {
    margin-bottom: 1rem;
}

.directions-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.directions-link:hover {
    text-decoration: underline;
}

.marker-photo {
    margin-top: 1rem;
}

/* ========== TRIP VIEW PAGE ========== */
.trip-profile {
    padding: 1rem;
    text-align: center;
    background: var(--bg-alt);
    border-bottom: 1px solid #e0e0e0;
}

.trip-profile h2 {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.trip-profile .marker-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

#trip-map {
    width: 100%;
    height: calc(100vh - 130px);
    min-height: 400px;
}

/* ========== PHOTO UPLOAD MODALS ========== */
.photo-modal,
.success-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.photo-modal.show,
.success-modal.show {
    opacity: 1;
    visibility: visible;
}

.photo-modal-content,
.success-modal-content {
    background: var(--bg);
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.photo-modal-content img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.photo-location {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.photo-map-picker {
    margin-bottom: 0.75rem;
}

.photo-map-picker .maplibregl-cooperative-gesture-screen {
    font-size: 0.85rem;
}

.photo-map-hint {
    font-size: 0.8rem;
    color: var(--accent);
    text-align: center;
    margin-top: 0.4rem;
}

.photo-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.photo-textarea {
    min-height: 80px;
    resize: vertical;
}

.photo-input:focus {
    outline: none;
    border-color: var(--accent);
}

.photo-modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.photo-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.photo-btn-primary {
    background: var(--accent);
    color: #fff;
}

.photo-btn-primary:hover {
    background: var(--accent-light);
}

.photo-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.photo-btn-secondary {
    background: var(--bg-alt);
    color: var(--text-muted);
}

.photo-btn-secondary:hover {
    background: #e0e0e0;
}

.success-modal-content {
    text-align: center;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 1rem;
}

.success-modal-content p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text);
}

.success-modal-content .photo-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}
