/* The Beach Score — Beach Conditions */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    background: #f8fafe;
    line-height: 1.6;
}

/* ── Navigation ── */
header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0077b6;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover { color: #0077b6; }

/* ── Main Layout ── */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* ── Hero / Score ── */
.hero {
    text-align: center;
    padding: 2.5rem 0 2rem;
}

.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.score-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0fdf4;
    border: 3px solid #22c55e;
}

.score-circle.score-good {
    background: #fefce8;
    border-color: #eab308;
}

.score-circle.score-fair {
    background: #fff7ed;
    border-color: #f97316;
}

.score-circle.score-poor {
    background: #fef2f2;
    border-color: #ef4444;
}

.score-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.score-label {
    font-size: 0.7rem;
    color: #64748b;
}

.score-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.score-verdict {
    font-size: 1.25rem;
    font-weight: 700;
}

.score-detail {
    font-size: 0.85rem;
    color: #64748b;
}

/* ── Conditions Grid ── */
.conditions-section {
    margin: 2rem 0;
}

.conditions-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .conditions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.condition-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.condition-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.condition-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.condition-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
}

.condition-detail {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.data-attribution {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 0.75rem;
}

/* ── Tides ── */
.tides-section, .best-time-section, .calculator-cta, .guide-section, .faq-section, .nearby-section {
    margin: 3rem 0;
    padding: 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.tides-section h2, .best-time-section h2, .calculator-cta h2, .guide-section h2, .faq-section h2, .nearby-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.tide-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.tide-row:last-child { border-bottom: none; }

.tide-type { font-weight: 600; }
.tide-time { color: #64748b; }
.tide-height { font-weight: 600; color: #0077b6; }

.data-source {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.75rem;
}

/* ── Best Time ── */
.best-time-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1rem;
}

.best-time-card p { margin-bottom: 0.5rem; }
.best-time-card p:last-child { margin-bottom: 0; }

/* ── Calculator CTA ── */
.calculator-cta {
    text-align: center;
    background: linear-gradient(135deg, #0077b6 0%, #023e8a 100%);
    color: #fff;
    border: none;
}

.calculator-cta h2 { color: #fff; }
.calculator-cta p { color: #caf0f8; margin-bottom: 1.5rem; }

.cta-button {
    display: inline-block;
    background: #fff;
    color: #0077b6;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.cta-button:hover { background: #caf0f8; }

/* ── Guide & FAQ ── */
.guide-section p { margin-bottom: 1rem; }
.guide-section h3 { margin: 1.5rem 0 0.5rem; font-size: 1.1rem; }

.faq-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 0;
}

.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.faq-item p { color: #475569; font-size: 0.95rem; }

/* ── Nearby ── */
.nearby-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #f8fafe;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    margin: 0.25rem;
}

.nearby-link:hover { border-color: #0077b6; }
.nearby-link strong { display: block; }
.nearby-link span { font-size: 0.8rem; color: #64748b; }

/* ── Cross-links ── */
.cross-links {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafe;
    border-radius: 8px;
}

.cross-links strong { display: block; margin-bottom: 0.75rem; }

#cross-link-items {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#cross-link-items a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid #0077b6;
    border-radius: 8px;
    color: #0077b6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

#cross-link-items a:hover { background: #caf0f8; }

/* ── Calculator Form ── */
.calculator-form-section {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-group input[type="radio"] {
    display: none;
}

.pill-group label {
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 0;
}

.pill-group input[type="radio"]:checked + label {
    background: #0077b6;
    border-color: #0077b6;
    color: #fff;
}

.submit-btn {
    width: 100%;
    padding: 0.85rem;
    background: #0077b6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.submit-btn:hover { background: #023e8a; }

/* ── Calculator Result ── */
.result-section {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
}

.result-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.result-score-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.result-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0fdf4;
    border: 3px solid #22c55e;
    flex-shrink: 0;
}

.result-score-circle.good {
    background: #fefce8;
    border-color: #eab308;
}

.result-score-circle.fair {
    background: #fff7ed;
    border-color: #f97316;
}

.result-score-circle.poor {
    background: #fef2f2;
    border-color: #ef4444;
}

.result-score-number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.result-score-label {
    font-size: 0.7rem;
    color: #64748b;
}

.result-verdict {
    font-size: 1.15rem;
    font-weight: 600;
}

.result-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafe;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.result-tips {
    margin-bottom: 1.5rem;
}

.result-tips h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.result-tips ul {
    list-style: none;
    padding: 0;
}

.result-tips li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.result-tips li:last-child { border-bottom: none; }

.result-back-link {
    display: inline-block;
    color: #0077b6;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-back-link:hover { text-decoration: underline; }

/* ── Beach Directory ── */
.directory-page {
    max-width: 1100px;
}

.directory-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.directory-search {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.directory-search:focus {
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.directory-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
    white-space: nowrap;
}

.directory-sort select {
    padding: 0.75rem 2rem 0.75rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}

.geo-status {
    text-align: center;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.geo-status.loading {
    background: #eff6ff;
    color: #1d4ed8;
}

.geo-status.denied {
    background: #fefce8;
    color: #854d0e;
}

.directory-state-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0077b6;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.directory-state-header:first-child {
    margin-top: 0;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.beach-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: #1a1a2e;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.beach-card:hover {
    border-color: #0077b6;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.12);
    transform: translateY(-2px);
}

.beach-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.beach-card-location {
    font-size: 0.85rem;
    color: #64748b;
}

.beach-card-distance {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 1.1rem;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.85rem;
}

footer a { color: #64748b; text-decoration: none; }
footer a:hover { color: #0077b6; }
footer p { margin-bottom: 0.5rem; }
