@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --brand-primary: #7F1D1D;
    --brand-secondary: #FEF2F2;
    --brand-accent: #fcd34d;
    --brand-bg: #FFFFFF;
    --brand-surface: #FAFAF9;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    background-color: var(--brand-surface);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.dark-mode {
    background-color: #0f1115;
    color: #e5e7eb;
}

body.dark-mode nav,
body.dark-mode footer,
body.dark-mode section,
body.dark-mode .bg-white {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
}

body.dark-mode .bg-gray-50,
body.dark-mode .bg-gray-100 {
    background-color: #1f2937 !important;
}

body.dark-mode .text-gray-900 {
    color: #f3f4f6 !important;
}

body.dark-mode .text-gray-600,
body.dark-mode .text-gray-500,
body.dark-mode .text-gray-400 {
    color: #9ca3af !important;
}

body.dark-mode .border-gray-100,
body.dark-mode .border-gray-200,
body.dark-mode .border-gray-50 {
    border-color: #374151 !important;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: #374151 !important;
}

body.dark-mode nav a,
body.dark-mode nav button,
body.dark-mode header a {
    color: #e5e7eb !important;
}

body.dark-mode nav a:hover,
body.dark-mode header a:hover {
    color: #f3f4f6 !important;
}

body.dark-mode .nav-link-underline {
    color: #e5e7eb !important;
}

body.dark-mode .whats-new-section {
    background-color: #111827 !important;
}

body.dark-mode .whats-new-section > .absolute {
    display: none !important;
}

.whats-new-section::before,
.whats-new-section::after {
    display: none;
}

body.dark-mode .whats-new-section::before,
body.dark-mode .whats-new-section::after {
    display: none !important;
}

body.dark-mode .whats-new-section {
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
}

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

/* Page Transitions */
.page-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0, 0, 1) forwards;
}

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

/* Header & Nav */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.nav-link-underline {
    position: relative;
    padding-bottom: 4px;
    transition: all 0.3s ease;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-primary);
    transition: width 0.3s ease;
}

.nav-link-underline.active::after {
    width: 100%;
}

.nav-link-underline.active {
    color: var(--brand-primary) !important;
}

/* Hexagon Grid for Home */
.hexagon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.whats-new-title {
    text-shadow: 0 8px 24px rgba(127, 29, 29, 0.12);
}

.hexagon-wrapper:hover {
    transform: scale(1.05);
    z-index: 50;
}

.hexagon-clip {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    overflow: hidden;
}

.hex-size-sm { width: 130px; height: 150px; }
.hex-size-md { width: 160px; height: 184px; }
.hex-size-lg { width: 200px; height: 230px; }

.hex-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: max-content;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.hex-row-1 {
    align-items: end;
}

.hex-row-2,
.hex-row-3 {
    margin-top: -3.2rem;
}

.hex-row-3 {
    transform: translateX(-5.5rem);
}

@media (max-width: 768px) {
    .hex-size-sm { width: 80px; height: 92px; }
    .hex-size-md { width: 100px; height: 115px; }
    .hex-size-lg { width: 120px; height: 138px; }

    .hex-row {
        gap: 0.5rem;
    }

    .hex-row-2,
    .hex-row-3 {
        margin-top: -1.9rem;
    }

    .hex-row-3 {
        transform: translateX(-3.5rem);
    }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 99px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Leaflet Overrides */
.leaflet-container {
    background: #f1f5f9 !important;
}

.leaflet-popup-content-wrapper {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.leaflet-control-layers {
    border-radius: 0.75rem !important;
    border: none !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-popup-tip-container {
    display: none;
}

/* Sidebar Item Map Active */
.sidebar-item-map.active {
    background-color: var(--brand-secondary);
    border-color: #fecaca;
}

/* Geolocation prompt for in-site navigation */
.geo-nav-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.geo-nav-modal--visible {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.geo-nav-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.geo-nav-modal__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem 1rem 0.75rem 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem 1.25rem 1.25rem;
    border: 1px solid #f1f5f9;
}

body.dark-mode .geo-nav-modal__panel {
    background: #111827;
    border-color: #374151;
}

.geo-nav-modal__title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.125rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

body.dark-mode .geo-nav-modal__title {
    color: #f3f4f6;
}

.geo-nav-modal__body {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
    margin-bottom: 1rem;
}

body.dark-mode .geo-nav-modal__body {
    color: #94a3b8;
}

.geo-nav-modal__error {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin-bottom: 1rem;
    font-weight: 600;
}

.geo-nav-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.geo-nav-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.geo-nav-btn:active {
    transform: scale(0.98);
}

.geo-nav-btn--primary {
    background: var(--brand-primary);
    color: #fff;
}

.geo-nav-btn--primary:hover {
    filter: brightness(1.08);
}

.geo-nav-btn--muted {
    background: #f1f5f9;
    color: #475569;
}

body.dark-mode .geo-nav-btn--muted {
    background: #1f2937;
    color: #e2e8f0;
}

.geo-nav-btn--full {
    width: 100%;
}

@media (min-width: 640px) {
    .geo-nav-modal {
        align-items: center;
    }

    .geo-nav-modal__panel {
        border-radius: 1rem;
    }
}
