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

:root {
    --sand: #f4f1f0;
    --sand-dark: #e4dad7;
    --ocean: #727eef;
    --ocean-light: #3946b7;
    --ink: #272b32;
    --ink-light: #64748b;
    --white: #ffffff;
    --highlight: #fefce8;
    --peach: #fce8e0;
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "DM Sans", -apple-system, sans-serif;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, var(--peach) 0%, var(--highlight) 199%);
    min-height: 100vh;
    color: var(--ink);
    line-height: 1.6;
}

/* Header */
header {
    background: var(--white);
    border-bottom: 1px solid var(--sand-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

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

.logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
}

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

.tagline {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-top: 0.1rem;
}

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

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

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

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

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

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

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

/* Map */
.map-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

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

/* List */
.list-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

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

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

.tab-btn {
    flex: 1;
    padding: 0.45rem 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;
}

.tab-btn.active {
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

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

.beach-item:hover {
    background: rgba(245, 240, 232, 0.5);
}

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

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

.beach-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

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

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

.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: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.beach-item.active .beach-type {
    background: #fde68a;
}

.beach-type.sandy {
    background: #fde68a;
    color: #92400e;
    font-family: var(--font-body);
}

.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.8rem;
    color: var(--ink-light);
    margin-top: 0.35rem;
}

.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;
    padding: 0.5rem;
    background: var(--ocean);
    color: var(--white);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.beach-directions:hover {
    background: var(--ocean-light);
}

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

.list-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sand-dark);
    font-size: 0.7rem;
    color: var(--ink-light);
    background: var(--sand);
}

.list-footer a {
    color: var(--ocean);
    text-decoration: none;
}

/* Ad slot */
.ad-slot {
    margin-bottom: 2rem;
    max-height: 100px;
    overflow: hidden;
}

.ad-slot-mobile {
    display: none;
}

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

/* FAQ Section */
.faq-section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.faq-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

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

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

.faq-item summary {
    padding: 1rem 0;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.faq-item summary::after {
    content: "+";
    font-size: 1.2rem;
    color: var(--ink-light);
}

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

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

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

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

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

.footer-disclaimer a {
    color: var(--ocean);
}

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

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

.footer-copyright {
    font-size: 0.75rem;
    color: var(--ink-light);
}

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

.leaflet-popup-content {
    margin: 12px 16px;
}

.popup-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

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

.popup-note {
    font-size: 0.75rem;
    color: var(--ink-light);
    opacity: 0.7;
    margin-bottom: 10px;
}

.popup-link {
    display: inline-block;
    font-size: 0.75rem;
    color: #ffffff !important;
    background: var(--ocean);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.popup-link:hover {
    background: var(--ocean-light);
    color: #ffffff !important;
}

.custom-marker {
    background: var(--ocean);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}

.custom-marker:hover {
    transform: scale(1.2);
}

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

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
}

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

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

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

    .logo {
        font-size: 1.25rem;
    }

    .tagline {
        display: none;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .header-btn {
        padding: 0.35rem;
        border-radius: 6px;
    }

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

    .header-btn span {
        display: none;
    }

    .main {
        padding: 1.5rem 2rem 4rem;
    }

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

    #map {
        height: 300px;
    }

    .list-container {
        max-height: none;
    }

    /* Hide desktop ad, show mobile sticky ad */
    .ad-slot {
        display: none;
    }

    .ad-slot-mobile {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 0.75rem 1rem;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }

    .ad-slot-mobile .ad-content {
        flex: 1;
        text-align: center;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--ink-light);
    }

    .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-mobile .ad-close:hover {
        color: var(--ink);
    }
}
