/* OBX '26 - 3-Column Coastal Editorial */

:root {
    --sand: #f5f0e8;
    --sand-dark: #e8e0d4;
    --cream: #faf8f5;
    --driftwood: #c4b8a8;
    --navy: #1a2634;
    --navy-light: #2d3d4f;
    --coral: #e07860;
    --coral-light: #f09080;
    --coral-dark: #c85848;
    --seafoam: #5ab8a0;
    --gold: #d4a855;
    --kevin: #7c68c8;
    --abby: #48a8b8;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Outfit', -apple-system, sans-serif;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 100px;
    --shadow: 0 2px 8px rgba(26, 38, 52, 0.08);
    --shadow-hover: 0 4px 16px rgba(26, 38, 52, 0.12);
    --shadow-modal: 0 20px 60px rgba(26, 38, 52, 0.25);
    --transition: 0.2s ease;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--sand);
    color: var(--navy);
    line-height: 1.5;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* App Container */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: var(--cream);
    border-bottom: 1px solid var(--driftwood);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: var(--space-lg);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.logo-year {
    font-weight: 300;
    font-style: italic;
    color: var(--coral);
}

.header-stats {
    display: flex;
    gap: var(--space-xl);
}

.header-stat {
    text-align: center;
}

.header-stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--navy);
    line-height: 1;
}

.header-stat.hearted .header-stat-num {
    color: var(--coral);
}

.header-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--driftwood);
    font-weight: 500;
}

/* 3-Column Layout */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr 440px;
    flex: 1;
    overflow: hidden;
}

/* Filters Panel (Left) */
.filters-panel {
    background: var(--cream);
    border-right: 1px solid var(--driftwood);
    padding: var(--space-lg) var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--driftwood);
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--sand);
    border: 1px solid var(--driftwood);
    color: var(--navy-light);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}

.pill:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.pill.active {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--cream);
}

.pill.kevin.active { background: var(--kevin); border-color: var(--kevin); }
.pill.abby.active { background: var(--abby); border-color: var(--abby); }
.pill.both.active {
    background: linear-gradient(135deg, var(--kevin), var(--abby));
    border-color: var(--kevin);
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: var(--sand);
    border: 1px solid var(--driftwood);
    color: var(--navy);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Big Select - for primary filters */
.big-select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--cream), var(--sand));
    border: 2px solid var(--coral);
    color: var(--navy);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e07860' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.big-select:hover {
    border-color: var(--coral-dark);
    box-shadow: var(--shadow-hover);
}

.big-select:focus {
    outline: none;
    border-color: var(--navy);
}

.primary-filters {
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--sand-dark);
}

/* Toggles */
.toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
    width: 36px;
    height: 20px;
    background: var(--driftwood);
    border-radius: var(--radius-pill);
    position: relative;
    transition: var(--transition);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-track {
    background: var(--coral);
}

.toggle input:checked + .toggle-track::after {
    transform: translateX(16px);
}

.hearts-toggle {
    padding: var(--space-md);
    background: rgba(224, 120, 96, 0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(224, 120, 96, 0.15);
}

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

.reset-btn {
    margin-top: auto;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--driftwood);
    color: var(--driftwood);
    font-size: 0.8rem;
    font-family: var(--font-body);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.reset-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}

/* Map Panel (Center) */
.map-panel {
    position: relative;
    background: var(--sand-dark);
}

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

.map-legend {
    position: absolute;
    bottom: var(--space-md);
    left: var(--space-md);
    display: flex;
    gap: var(--space-md);
    padding: 8px 14px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--navy-light);
    box-shadow: var(--shadow);
    z-index: 400;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.legend-dot.kevin { background: var(--kevin); }
.legend-dot.abby { background: var(--abby); }
.legend-dot.both { background: linear-gradient(135deg, var(--kevin), var(--abby)); }

.legend-heart {
    width: 12px;
    height: 12px;
    background: var(--coral);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 0;
}

.leaflet-popup-tip { background: white; }

.leaflet-popup-content {
    margin: 0;
    min-width: 220px;
}

.popup-card {
    display: flex;
    gap: var(--space-sm);
}

.popup-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    flex-shrink: 0;
}

.popup-info {
    padding: var(--space-sm);
    flex: 1;
}

.popup-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--navy);
}

.popup-meta {
    font-size: 0.75rem;
    color: var(--navy-light);
    line-height: 1.4;
}

.popup-linds {
    margin-top: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--coral);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-price {
    margin-top: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy);
}

/* List Panel (Right) */
.list-panel {
    background: var(--cream);
    border-left: 1px solid var(--driftwood);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--sand-dark);
    flex-shrink: 0;
}

.list-count {
    font-size: 0.85rem;
    color: var(--navy-light);
}

.list-count span {
    font-weight: 600;
    color: var(--coral);
}

.list-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

/* List Item */
.list-item {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-sm);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--driftwood);
    z-index: 1;
}

.list-item.kevin::before { background: var(--kevin); }
.list-item.abby::before { background: var(--abby); }
.list-item.both::before { background: linear-gradient(180deg, var(--kevin), var(--abby)); }
.list-item.linds::before { background: linear-gradient(180deg, var(--coral), var(--coral-light)); }

.list-item:hover {
    box-shadow: var(--shadow-hover);
}

.list-item.expanded {
    border-color: var(--navy);
}

.list-item-main {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    align-items: center;
}

.list-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--sand-dark);
}

.list-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-xs);
}

.list-item-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.badge {
    padding: 2px 6px;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-pill);
}

.badge-linds { background: var(--coral); color: white; font-size: 0.7rem; }
.badge-no-pets { background: var(--coral-dark); color: white; }
.badge-1-dog { background: var(--gold); color: var(--navy); }
.badge-8night { background: var(--seafoam); color: white; }
.badge-source { font-weight: 500; }
.badge-source-airbnb { background: #FF5A5F; color: white; }
.badge-source-vrbo { background: #3b5998; color: white; }
.badge-source-twiddy { background: #1a5276; color: white; }
.badge-source-sun-realty { background: #f39c12; color: white; }

.list-item-location {
    font-size: 0.7rem;
    color: var(--driftwood);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-dates {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--coral);
    margin-top: 2px;
}

.list-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
    padding-left: var(--space-sm);
    flex-shrink: 0;
}

.price-total {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.2;
}

.price-per-night {
    font-size: 0.7rem;
    color: var(--driftwood);
    font-weight: 400;
}

.price-highlight {
    font-weight: 600;
    color: var(--coral);
    font-size: 0.9rem;
}

.no-results {
    padding: var(--space-xl);
    text-align: center;
    color: var(--driftwood);
    font-style: italic;
}

.week-select {
    font-weight: 500;
    border-color: var(--coral);
}

.list-item-stats {
    display: flex;
    gap: var(--space-sm);
    margin-top: auto;
    padding-top: var(--space-xs);
}

.list-item-stat {
    font-size: 0.7rem;
    color: var(--navy-light);
}

.list-item-stat strong {
    font-weight: 600;
    color: var(--navy);
}

.list-item-rating {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 500;
}

.list-item-chevron {
    font-size: 0.7rem;
    color: var(--driftwood);
    margin-left: var(--space-sm);
    transition: var(--transition);
}

.list-item:hover .list-item-chevron {
    color: var(--coral);
}

/* Expanded State */
.list-item-expanded {
    display: none;
    border-top: 1px solid var(--sand-dark);
    background: var(--sand);
}

.list-item.expanded .list-item-expanded {
    display: block;
}

/* Image Slider */
.expanded-slider {
    position: relative;
    height: 180px;
    background: var(--sand-dark);
    overflow: hidden;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slider-img.active {
    opacity: 1;
}

.slider-controls {
    position: absolute;
    bottom: var(--space-sm);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255,255,255,0.9);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}

.slider-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--coral);
}

.slider-dots {
    display: flex;
    gap: 5px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--driftwood);
    cursor: pointer;
    transition: var(--transition);
}

.slider-dot.active {
    background: var(--coral);
}

.slider-dot:hover {
    background: var(--navy);
}

/* Expanded Details */
.expanded-details {
    padding: var(--space-md);
}

.expanded-stats {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--sand-dark);
    margin-bottom: var(--space-sm);
}

.expanded-stat {
    font-size: 0.8rem;
    color: var(--navy-light);
}

.expanded-stat strong {
    color: var(--navy);
}

.expanded-row {
    display: flex;
    gap: var(--space-sm);
    padding: 4px 0;
    font-size: 0.8rem;
}

.expanded-label {
    color: var(--driftwood);
    min-width: 60px;
}

.expanded-value {
    color: var(--navy);
}

.expanded-pet {
    font-weight: 500;
}

.expanded-pet.ok {
    color: var(--seafoam);
}

.expanded-pet.no-pets {
    color: var(--coral-dark);
}

.expanded-btn {
    display: block;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--navy);
    color: white;
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.expanded-btn:hover {
    background: var(--coral);
}


/* Mobile */
.mobile-filters {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 200px 1fr 340px;
    }
}

@media (max-width: 900px) {
    .header {
        padding: var(--space-sm) var(--space-md);
    }

    .logo { font-size: 1.5rem; }

    .header-stats {
        gap: var(--space-md);
    }

    .header-stat-num { font-size: 1.25rem; }

    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 40vh;
    }

    .filters-panel {
        display: none;
    }

    .filters-panel.open {
        display: flex;
        position: fixed;
        inset: 0;
        top: auto;
        height: 65vh;
        z-index: 9999999;
        border-radius: var(--radius) var(--radius) 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        animation: slideUp 0.3s ease;
    }

    .map-panel {
        order: 1;
    }

    .list-panel {
        order: 2;
        border-left: none;
        border-top: 1px solid var(--driftwood);
    }

    .mobile-filters {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: var(--space-sm);
        background: var(--cream);
        border-top: 1px solid var(--driftwood);
        z-index: 999;
    }

    .mobile-filter-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: var(--space-sm);
        padding: var(--space-md);
        background: var(--navy);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        font-family: var(--font-body);
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
    }

    .filter-count {
        background: var(--coral);
        padding: 2px 8px;
        border-radius: var(--radius-pill);
        font-size: 0.75rem;
    }

    .filter-count:empty { display: none; }

    .list-items {
        padding-bottom: 80px;
    }

    .expanded-slider {
        height: 150px;
    }
}

@media (max-width: 600px) {
    .header-stats {
        gap: var(--space-sm);
    }

    .header-stat-label {
        font-size: 0.55rem;
    }

    .list-item-img {
        width: 56px;
        height: 56px;
    }

    .expanded-slider {
        height: 120px;
    }

    .expanded-stats {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--driftwood); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-light); }
