:root {
    --primary: #155e75;
    --primary-hover: #0f4c5c;
    --accent: #f59e0b;
    --text-main: #0f172a;
    --text-muted: #475569;
    --bg-glass: rgba(255, 255, 255, 0.88);
    --border-glass: rgba(255, 255, 255, 0.45);
    --shadow-soft: 0 18px 45px -18px rgba(15, 23, 42, 0.42);
    --panel-width: min(92vw, 760px);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    overflow: hidden;
    background: linear-gradient(180deg, #d7f0ff 0%, #eef7ff 100%);
}

#map {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.search-container {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: var(--panel-width);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.logo {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 600;
    color: #082f49;
    text-align: center;
    letter-spacing: -0.04em;
    text-shadow: 0 8px 22px rgba(255, 255, 255, 0.8);
}

.search-panel,
.results-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-soft);
}

.search-panel {
    display: grid;
    gap: 16px;
    border-radius: 28px;
    padding: 18px;
}

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

.search-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-field input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    padding: 14px 16px;
    font: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.search-field input:focus {
    border-color: rgba(21, 94, 117, 0.45);
    box-shadow: 0 0 0 4px rgba(21, 94, 117, 0.14);
    transform: translateY(-1px);
}

.date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.search-submit {
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 14px 18px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.2s ease, opacity 0.2s ease;
}

.search-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.search-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.search-submit:disabled,
.search-field input:disabled {
    opacity: 0.75;
    cursor: wait;
}

.feedback-container {
    min-height: 44px;
    display: flex;
    justify-content: center;
}

.feedback-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.55);
}

.feedback-chip.loading {
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.feedback-chip.error {
    background: rgba(254, 226, 226, 0.96);
    color: #b91c1c;
    border: 1px solid rgba(254, 202, 202, 0.65);
}

.results-panel {
    border-radius: 28px;
    padding: 20px;
    max-height: min(52vh, 560px);
    overflow: auto;
}

.results-heading {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.results-heading h2 {
    font-size: 22px;
    font-weight: 600;
    color: #082f49;
}

.results-heading p,
.results-meta {
    color: var(--text-muted);
    line-height: 1.4;
}

.results-meta {
    margin-bottom: 18px;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.weather-card {
    border-radius: 20px;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(226, 247, 255, 0.88) 100%);
    border: 1px solid rgba(191, 219, 254, 0.7);
}

.weather-card-date {
    font-size: 13px;
    font-weight: 600;
    color: #0c4a6e;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.weather-card h3 {
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 14px;
}

.weather-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
}

.weather-card-metrics dt {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.weather-card-metrics dd {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .search-container {
        top: 16px;
        gap: 12px;
    }

    .search-panel,
    .results-panel {
        border-radius: 22px;
    }

    .date-range {
        grid-template-columns: 1fr;
    }

    .results-panel {
        max-height: 48vh;
    }

    .weather-grid {
        grid-template-columns: 1fr;
    }
}

/* Surf Report Styles */
.search-actions {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
}

.surf-btn {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.surf-report-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.surf-quality {
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.surf-metrics-main {
    display: flex;
    gap: 24px;
    align-items: baseline;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.metric-unit {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.surf-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.surf-card-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-item span {
    font-size: 16px;
    font-weight: 600;
}

.unit-toggle {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.unit-toggle-button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    min-width: 52px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.unit-toggle-button.is-active {
    background: #0f172a;
    color: white;
}

@media (max-width: 640px) {
    .search-actions {
        grid-template-columns: 1fr;
    }

    .surf-details-grid {
        grid-template-columns: 1fr;
    }
}
