/* ============================================================
   Caravan Park Finder — Styles
   Matching the purple/lavender design from reference images
   ============================================================ */

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

#cpf-finder-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2d1b6e;
    max-width: 100%;
    margin: 0;
}

/* ── Search Panel ─────────────────────────────────────────── */
.cpf-search-panel {
    background: linear-gradient(135deg, #f3eeff 0%, #fce8ff 50%, #ede0ff 100%);
    border-radius: 20px;
    padding: 32px 36px 28px;
    margin-bottom: 0;
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
}

.cpf-search-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cpf-keyword-row {
    align-items: flex-end;
}

.cpf-filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.cpf-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cpf-keyword-group {
    flex: 1;
    min-width: 300px;
}

.cpf-sort-group {
    min-width: 180px;
}

.cpf-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d1b6e;
    display: block;
}

/* Inputs */
.cpf-input {
    height: 50px;
    padding: 0 48px 0 18px;
    border: 1.5px solid #e0d4f7;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    color: #2d1b6e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.cpf-input::placeholder {
    color: #a89fcc;
}

.cpf-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.cpf-input-with-icon {
    position: relative;
}

.cpf-search-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: #7c3aed;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    color: #fff;
    padding: 0;
}

.cpf-search-icon:hover {
    background: #6d28d9;
    transform: translateY(-50%) scale(1.05);
}

.cpf-search-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

/* Selects */
.cpf-select-wrap {
    position: relative;
}

.cpf-select {
    height: 50px;
    padding: 0 44px 0 18px;
    border: 1.5px solid #e0d4f7;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    color: #2d1b6e;
    background: #fff;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.cpf-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.cpf-select option {
    color: #2d1b6e;
}

.cpf-select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: #7c3aed;
    pointer-events: none;
}

/* Action Buttons */
.cpf-search-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cpf-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.cpf-btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.cpf-btn-primary:active {
    transform: translateY(0);
}

.cpf-btn-clear {
    background: none;
    border: none;
    color: #7c3aed;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}

.cpf-btn-clear:hover {
    color: #6d28d9;
}

/* ── Results Bar ──────────────────────────────────────────── */
.cpf-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #ede9fe;
    font-size: 14px;
    color: #5b3f9a;
    font-weight: 500;
}

.cpf-view-toggle {
    display: flex;
    gap: 6px;
}

.cpf-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #e0d4f7;
    border-radius: 8px;
    background: #fff;
    color: #7c3aed;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

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

.cpf-view-btn.active,
.cpf-view-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.cpf-view-btn.active svg,
.cpf-view-btn:hover svg {
    stroke: #fff;
}

/* ── Loading ──────────────────────────────────────────────── */
.cpf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #7c3aed;
    font-weight: 500;
}

.cpf-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #ede9fe;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: cpf-spin 0.7s linear infinite;
}

@keyframes cpf-spin {
    to { transform: rotate(360deg); }
}

/* ── Map ──────────────────────────────────────────────────── */
.cpf-map-container {
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

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

/* ── Map Info Window ──────────────────────────────────────── */
.cpf-info-window {
    font-family: 'Inter', sans-serif;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #B164E3;
}

.cpf-info-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.cpf-info-img-placeholder {
    width: 100%;
    height: 117px;
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpf-info-body {
    padding: 0px;
    background: #fff;
}

.cpf-info-title {
    font-size: 20px;
    font-weight: 700;
    color: #592E83;
    margin: 0 0 4px;
    line-height: 1.3;
}

.cpf-info-area {
    font-size: 12px;
    color: #7c3aed;
    font-weight: 500;
    margin: 0 0 4px;
}

.cpf-info-season {
    font-size: 12px;
    color: #32571F;
    margin: 0 0 12px;
}

.cpf-info-season strong {
    color: #592E83;
}
p.cpf-info-area {
    color: #32571F;
    font-weight: 700;
}

.cpf-info-link {
    display: block;
    background: #BD5BEA;
    color: #fff !important;
    text-align: center;
    padding: 9px 14px;
    border-radius: 0px 0px 20px 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.2s;
}

.cpf-info-inner-wrp {
    padding: 10px 15px;
    text-align: center;
}

.cpf-info-link:hover {
    opacity: 0.9;
}

/* ── List / Grid View ─────────────────────────────────────── */
.cpf-list-container {
    padding: 24px 0;
}

.cpf-parks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.leaflet-popup-content p {
    margin: 0;
    font-weight: 600;
}
.cpf-park-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.08);
    border: 1.5px solid #f0ebff;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.cpf-park-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.16);
}

.cpf-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.cpf-card-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #ede9fe, #fce7f3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4b5fd;
    font-size: 40px;
}

.cpf-card-body {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cpf-card-area {
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.cpf-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #2d1b6e;
    margin: 0 0 8px;
    line-height: 1.3;
}

.cpf-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
}

.cpf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cpf-card-badge {
    background: #f3eeff;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e0d4f7;
}

.cpf-card-link {
    display: block;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff !important;
    text-align: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.2s;
    margin-top: auto;
}

.cpf-card-link:hover {
    opacity: 0.9;
}

/* ── No Results ───────────────────────────────────────────── */
.cpf-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #a89fcc;
}

.cpf-no-results svg {
    stroke: #c4b5fd;
    margin-bottom: 16px;
}

.cpf-no-results h3 {
    color: #5b3f9a;
    font-size: 18px;
    margin: 0 0 8px;
}

.cpf-no-results p {
    font-size: 14px;
    color: #9ca3af;
    max-width: 320px;
    margin: 0 auto;
}

/* ── Custom Map Marker SVG ────────────────────────────────── */
.cpf-marker-label {
    display: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .cpf-search-panel {
        padding: 24px 20px 20px;
    }
    .cpf-filters-row {
        grid-template-columns: 1fr 1fr;
    }
    .cpf-keyword-row {
        flex-direction: column;
        align-items: stretch;
    }
    .cpf-sort-group {
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .cpf-filters-row {
        grid-template-columns: 1fr;
    }
    #cpf-map {
        height: 420px;
    }
    .cpf-parks-grid {
        grid-template-columns: 1fr;
    }
    .cpf-search-panel {
        border-radius: 12px;
    }
    .cpf-btn-primary {
        width: 100%;
        justify-content: center;
    }
}



/* ============================================================
   Leaflet Popup Overrides
   ============================================================ */

/* Remove default white border/shadow, let our inner div style it */
.cpf-leaflet-popup .leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(44, 27, 110, 0.18) !important;
    border: none !important;
}

.cpf-leaflet-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 206px !important;
    line-height: 1.4 !important;
}

.cpf-leaflet-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}

.cpf-leaflet-popup .leaflet-popup-tip {
    background: #BD5BEA !important;
    box-shadow: none !important;
}

.cpf-leaflet-popup .leaflet-popup-close-button {
    top: 6px !important;
    right: 6px !important;
    width: 24px !important;
    height: 24px !important;
    background: rgba(255,255,255,0.85) !important;
    border-radius: 50% !important;
    color: #7c3aed !important;
    font-size: 16px !important;
    line-height: 24px !important;
    text-align: center !important;
    z-index: 10;
}

/* Leaflet zoom controls purple */
.leaflet-control-zoom a {
    color: #7c3aed !important;
    border-color: #e0d4f7 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f3eeff !important;
}

/* Attribution link */
.leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255,255,255,0.75) !important;
}
