:root {
    --bg: #0b1220;
    --card: rgba(15, 23, 42, 0.7);
    --card-border: rgba(148, 163, 184, 0.2);
    --primary: #38bdf8;
    --accent: #fbbf24;
    --text: #e2e8f0;
    --muted: #94a3b8;
}

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

body {
    font-family: "Noto Sans KR", "Outfit", sans-serif;
    background: radial-gradient(circle at top, #102a43 0%, #0b1220 45%, #060b15 100%);
    color: var(--text);
    min-height: 100vh;
}

.background-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.blob-1 {
    background: rgba(56, 189, 248, 0.4);
    top: -120px;
    left: -120px;
}

.blob-2 {
    background: rgba(251, 191, 36, 0.35);
    bottom: -140px;
    right: -120px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.back-btn {
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
    border-color: var(--primary);
}

.brand-label {
    font-family: "Outfit", sans-serif;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #0ea5e9, #2dd4bf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.2rem;
}

.beach-weather-header {
    text-align: center;
    margin-bottom: 28px;
}

.beach-weather-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
}

.page-description {
    margin: 12px auto 24px;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.6;
}

.search-container {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 44px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1rem;
    font-family: "Noto Sans KR", sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.search-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.3s ease;
}

.search-btn:hover {
    color: var(--primary);
}

.helper-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 35px rgba(2, 6, 23, 0.5);
    max-height: 280px;
    overflow-y: auto;
    z-index: 5;
}

.search-results button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text);
    padding: 12px 14px;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.search-results button:hover {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.12);
}

.selected-beach {
    margin: 18px auto 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
}

.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.status-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--muted);
}

.status-item strong {
    color: var(--text);
    font-size: 1.05rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.ad-section {
    min-height: 90px;
    margin: 10px auto 28px;
    text-align: center;
}

.summary-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 130px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.card-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.card-sub {
    font-size: 0.9rem;
    color: var(--muted);
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
}


.forecast-section,
.tide-section {
    margin-bottom: 28px;
}

.forecast-table {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
}

.forecast-header,
.forecast-row {
    display: grid;
    grid-template-columns: 1.2fr repeat(5, 1fr);
    padding: 12px 16px;
    gap: 10px;
    font-size: 0.92rem;
}

.forecast-header {
    background: rgba(30, 41, 59, 0.7);
    color: var(--muted);
    font-weight: 600;
}

.forecast-row {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.forecast-row.placeholder {
    color: var(--muted);
}

.tide-list {
    display: grid;
    gap: 10px;
}

.tide-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.95rem;
}

.tide-item.placeholder {
    color: var(--muted);
}

.loading-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    color: var(--muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.error-msg {
    margin-top: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fecaca;
    padding: 14px 16px;
    border-radius: 12px;
    display: none;
    text-align: center;
}

.source-info {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
}

.source-label {
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.source-text {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .beach-weather-header h1 {
        font-size: 2rem;
    }

    .forecast-header,
    .forecast-row {
        grid-template-columns: 1.2fr repeat(2, 1fr);
        grid-auto-rows: auto;
    }

    .forecast-header span:nth-child(n+4),
    .forecast-row span:nth-child(n+4) {
        display: none;
    }
}
