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

:root {
    /* Warm & Vibrant palette */
    --sand: #faf6f1;
    --sand-dark: #efe8df;
    --coral: #e85d4c;
    --coral-light: #f17968;
    --coral-pale: #fef0ee;
    --sun: #f5a623;
    --sun-light: #ffecd2;
    --teal: #1a9e8c;
    --teal-light: #22b8a2;
    --teal-pale: #e6f7f5;
    --ink: #2d2a26;
    --ink-light: #8b857d;
    --white: #ffffff;
    --font-display: "Manrope", -apple-system, sans-serif;
    --font-body: "Manrope", -apple-system, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm:
        0 1px 3px rgba(45, 42, 38, 0.06), 0 1px 2px rgba(45, 42, 38, 0.04);
    --shadow-md:
        0 4px 16px rgba(45, 42, 38, 0.08), 0 2px 4px rgba(45, 42, 38, 0.04);
}

body {
    font-family: var(--font-body);
    background: var(--sand);
    min-height: 100vh;
    color: var(--ink);
    line-height: 1.6;
}

/* Accessibility - visually hidden but available to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sand-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-img {
    width: 72px;
    height: 72px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--teal);
}

.tagline {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-top: 0.15rem;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s ease;
}

.header-btn:hover {
    background: var(--sand);
    border-color: var(--sand-dark);
}

.header-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

a.header-btn {
    text-decoration: none;
}

/* Main Layout */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 1.5rem;
}

.map-list-section {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Map */
.map-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand-dark);
}

#map {
    height: 580px;
    width: 100%;
}

/* List */
.list-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand-dark);
    display: flex;
    flex-direction: column;
    max-height: 580px;
}

.list-header {
    padding: 0.875rem;
    border-bottom: 1px solid var(--sand-dark);
    background: var(--white);
}

.list-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--sand);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-body);
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink-light);
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: var(--ink);
}

.tab-btn.active {
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.list-content {
    flex: 1;
    overflow-y: auto;
}

.beach-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--sand);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.875rem;
}

.beach-item:last-child {
    border-bottom: none;
}

.beach-item:hover {
    background: var(--sand);
}

.beach-info {
    flex: 1;
    min-width: 0;
}

.beach-item.active {
    background: var(--teal-pale);
    border-left: 3px solid var(--teal);
    padding-left: calc(1rem - 3px);
}

.beach-item.active:hover {
    background: var(--teal-pale);
}

.beach-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.2rem;
    line-height: 1.35;
}

.beach-area {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--ink-light);
}

.dot {
    color: var(--ink-light);
    margin: 0 0.3rem;
    opacity: 0.5;
}

.beach-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ink-light);
}

.beach-type {
    padding: 0.1rem 0.4rem;
    background: var(--sand-dark);
    color: var(--ink-light);
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.beach-item.active .beach-type {
    background: var(--sun-light);
    color: var(--ink);
}

.beach-type.sandy {
    background: var(--sun-light);
    color: var(--coral);
    font-family: var(--font-body);
    font-weight: 600;
}

.beach-secondary {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.beach-note {
    font-size: 0.75rem;
    color: var(--ink-light);
    margin-top: 0.25rem;
    line-height: 1.4;
    font-weight: 500;
}

.beach-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.beach-directions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--teal);
    color: var(--white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.beach-directions:hover {
    background: var(--teal-light);
    transform: translateY(-1px);
}

.beach-directions svg {
    width: 15px;
    height: 15px;
}

/* Sticky bottom ad - shared styles */
.ad-slot,
.ad-slot-mobile {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 999;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.ad-slot .ad-content,
.ad-slot-mobile .ad-content {
    flex: 1;
    text-align: center;
}

.ad-slot .ad-close,
.ad-slot-mobile .ad-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--ink-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slot .ad-close:hover,
.ad-slot-mobile .ad-close:hover {
    color: var(--ink);
}

.ad-slot.hidden,
.ad-slot-mobile.hidden {
    display: none !important;
}

/* Desktop: show .ad-slot, hide .ad-slot-mobile */
.ad-slot-mobile {
    display: none;
}

@media (max-width: 768px) {
    .ad-slot {
        display: none;
    }
    .ad-slot-mobile {
        display: flex;
    }
}

/* Intro Section */
.intro-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand-dark);
}

.intro-section h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--ink);
}

.intro-section p {
    color: var(--ink-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.intro-section p:last-child {
    margin-bottom: 0;
}

.intro-section strong {
    color: var(--ink);
}

/* Info Sections (Regulations, Tips) */
.info-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand-dark);
}

.info-section h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--ink);
}

.info-section h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--ink);
}

.info-section h3:first-of-type {
    margin-top: 1rem;
}

.info-section p {
    color: var(--ink-light);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-section strong {
    color: var(--ink);
}

.info-section ul {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
}

.info-section li {
    color: var(--ink-light);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.info-section li strong {
    color: var(--ink);
}

.info-section li:last-child {
    margin-bottom: 0;
}

/* FAQ Section */
.faq-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--sand-dark);
}

.faq-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--ink);
}

.faq-item {
    border-bottom: 1px solid var(--sand);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item summary {
    padding: 0.875rem 0;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--ink-light);
    margin-left: 1rem;
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    padding-bottom: 0.875rem;
    color: var(--ink-light);
    font-size: 0.875rem;
    line-height: 1.7;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--white);
    border-top: 1px solid var(--sand-dark);
    padding: 2rem 1.5rem;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-disclaimer {
    background: var(--sand);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-disclaimer a {
    color: var(--teal);
    text-decoration: none;
}

.footer-disclaimer a:hover {
    text-decoration: underline;
}

.footer-links {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--teal);
    text-decoration: none;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--ink-light);
    opacity: 0.8;
    text-align: right;
}

/* Leaflet customizations */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    font-family: var(--font-body);
    box-shadow: var(--shadow-md);
}

.leaflet-popup-content {
    margin: 14px 18px;
}

.popup-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--ink);
}

.popup-location {
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-bottom: 6px;
}

.popup-note {
    font-size: 0.75rem;
    color: var(--ink-light);
    opacity: 0.8;
    margin-bottom: 12px;
    line-height: 1.4;
}

.popup-link {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--white) !important;
    background: var(--teal);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease;
}

.popup-link:hover {
    background: var(--teal-light);
    color: var(--white) !important;
}

.custom-marker {
    background: var(--teal);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(26, 158, 140, 0.4);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.custom-marker:hover {
    transform: scale(1.25);
    box-shadow: 0 3px 12px rgba(26, 158, 140, 0.5);
}

.leaflet-top.leaflet-left {
    top: 12px;
    left: 12px;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    color: var(--ink) !important;
    border-bottom-color: var(--sand) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--sand) !important;
}

/* Mobile */
@media (max-width: 800px) {
    header {
        position: static;
        background: var(--white);
    }

    .header-inner {
        padding: 0.75rem 1rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .logo {
        font-size: 1.3rem;
        line-height: 1.25;
    }

    .logo span {
        display: block;
    }

    .tagline {
        display: none;
    }

    .header-actions {
        gap: 0.4rem;
        flex-shrink: 0;
        margin-left: auto;
    }

    .logo-group {
        margin-right: 0.75rem;
    }

    .header-btn {
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        font-size: 0.8rem;
    }

    .header-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Hide FAQ button on mobile, keep Find nearest with text */
    a.header-btn[href="#faq"] {
        display: none;
    }

    .main {
        padding: 1rem;
    }

    .map-list-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #map {
        height: 220px;
    }

    .list-container {
        max-height: none;
        display: flex;
        flex-direction: column;
    }

    .list-content {
        overflow-y: auto;
        max-height: 50vh;
    }

    .list-footer {
        display: none;
    }

    .beach-item {
        padding: 0.75rem 0.875rem;
    }

    .beach-name {
        font-size: 0.95rem;
    }

    .beach-directions {
        width: 32px;
        height: 32px;
    }

    .beach-directions svg {
        width: 14px;
        height: 14px;
    }
}

/* Weather Widget */
.beach-weather {
    margin-top: 0.4rem;
}

.weather-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.weather-tab {
    background: var(--sand);
    text-align: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    color: var(--ink);
    border-radius: 10px;
    white-space: nowrap;
    font-weight: 500;
}

.weather-loading {
    display: inline-block;
    background: var(--sand);
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--ink-light);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.weather-error {
    display: inline-block;
    background: var(--sand);
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--ink-light);
}

/* Weather in popup */
.leaflet-popup-content .beach-weather {
    margin-top: 8px;
    margin-bottom: 8px;
}

.leaflet-popup-content .weather-tabs {
    padding: 0;
}

.leaflet-popup-content .weather-tab {
    padding: 0.15rem 0.4rem;
    font-size: 0.68rem;
}

@media (max-width: 800px) {
    .weather-tab {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    .intro-section,
    .info-section,
    .faq-section {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .intro-section h2,
    .info-section h2 {
        font-size: 1.15rem;
    }

    .info-section h3 {
        font-size: 1rem;
    }

    .intro-section p,
    .info-section p,
    .info-section li {
        font-size: 0.85rem;
    }

    .faq-section {
        padding: 1rem 1.25rem;
    }

    .faq-title {
        font-size: 1.05rem;
    }

    .faq-item summary {
        font-size: 0.85rem;
        padding: 0.75rem 0;
    }

    .faq-item p {
        font-size: 0.8rem;
    }
}
