/* ================================================
   TidesAtlas — Global Tide Predictions
   Color scheme: Ocean Blue (#5b52f4 / #3974ff)
   ================================================ */

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

:root {
    --primary: #5b52f4;
    --primary-dark: #4b38e9;
    --primary-light: #7273fc;
    --accent: #3974ff;
    --accent-light: #5d7cf9;
    --dark: #141135;
    --dark-mid: #242449;
    --gray-900: #16142f;
    --gray-700: #3c3e5a;
    --gray-500: #706f87;
    --gray-400: #a1a0b3;
    --gray-300: #d4d4de;
    --gray-200: #e6e6ec;
    --gray-100: #f4f4f7;
    --gray-50: #f9f9fb;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

html, body {
    overflow-x: hidden;
}
body {
    font-family: 'Outfit', -apple-system, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ── */
.header {
    background: #2e3479;
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(37,62,92,0.4);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--white);
    letter-spacing: -0.5px;
}
.logo:hover { color: var(--white); }
.logo svg { color: var(--white); opacity: 0.9; }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    position: relative;
    transition: all var(--transition);
}
.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: width 0.3s;
}
.nav a:hover { color: var(--white); }
.nav a:hover::after { width: 100%; }

/* Login button */
.nav a.nav-login-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    position: static;
}
.nav a.nav-login-btn::after { content: none; }
.nav a.nav-login-btn:hover { background: rgba(255,255,255,0.22); }

/* Lang selector */
.lang-selector { position: relative; }
.lang-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}
.lang-btn:hover { background: rgba(255,255,255,0.25); }
.lang-dropdown {
    position: absolute;
    top: 100%;
    padding-top: 4px;
    right: 0;
    background: transparent;
    min-width: 80px;
    display: none;
    z-index: 200;
}
.lang-dropdown-inner {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.lang-selector:hover .lang-dropdown { display: block; }
.lang-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--gray-700) !important;
    font-weight: 500;
    font-size: 0.85rem;
    background: var(--white);
}
.lang-dropdown a:hover { background: var(--gray-100); color: var(--gray-700) !important; }
.lang-dropdown a.active { background: var(--primary); color: var(--white) !important; }
.lang-dropdown a.active:hover { background: #4b38e9; color: var(--white) !important; }

/* Mobile menu */
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; -webkit-tap-highlight-color: transparent; }
.mobile-menu-btn span {
    display: block; width: 24px; height: 2px;
    background: var(--white); margin: 5px 0;
    transition: var(--transition);
}
.nav-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden;
    transition: all 0.3s ease; z-index: 1010;
}
.nav-overlay.active { opacity: 1; visibility: visible; }

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 50%, var(--accent) 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30 Q15 20 30 30 Q45 40 60 30' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2'/%3E%3C/svg%3E");
    opacity: 0.5;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px; }
.hero p { font-size: 1.15rem; opacity: 0.85; max-width: 600px; margin: 0 auto 2rem; line-height: 1.7; }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2rem; font-weight: 800; display: block; }
.hero-stat .label { font-size: 0.85rem; opacity: 0.7; }

/* Search bar */
.search-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}
.search-container input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 3rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: var(--white);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}
.search-container input::placeholder { color: rgba(255,255,255,0.5); }
.search-container input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #16142f;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-height: 360px;
    overflow-y: auto;
    display: none;
    z-index: 300;
    text-align: left;
}
.search-results.active { display: block; }
.search-results .result-section {
    padding: 0.6rem 1.25rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6d7097;
}
.search-results .result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.25rem;
    color: #e6e7f2;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.search-results .result-item:last-child { border-bottom: none; }
.search-results .result-item:hover { background: rgba(56,189,248,0.08); }
.search-results .result-item .station-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .result-item .station-name strong { color: #7d97fe; font-weight: 600; }
.search-results .result-item .station-id {
    font-size: 0.72rem; color: #6d7097; background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.55rem; border-radius: 4px; margin-left: 0.75rem; white-space: nowrap;
}
.search-results .no-results {
    padding: 1.25rem; text-align: center; color: #6d7097; font-size: 0.9rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
    padding: 1rem 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.breadcrumb-list {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    list-style: none; font-size: 0.85rem;
}
.breadcrumb-list li::after { content: '/'; margin-left: 0.5rem; color: var(--gray-400); }
.breadcrumb-list li:last-child::after { display: none; }
.breadcrumb-list a { color: var(--gray-500); }
.breadcrumb-list a:hover { color: var(--primary); }
.breadcrumb-list li:last-child { color: var(--gray-900); font-weight: 600; }

/* ── Page Header ── */
.page-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 2.5rem 0;
}
.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-header p { opacity: 0.8; font-size: 0.95rem; }

/* ── Section & Cards ── */
.section { padding: 3rem 0; }
.section-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--dark); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.card {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    border: 1px solid #e6e7f2;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #5b52f4, #5d7cf9);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(37,99,235,0.12), 0 4px 12px rgba(15,23,42,0.06);
    border-color: rgba(37,99,235,0.25);
}
.card:hover::before { opacity: 1; }
a.card-link { display: block; text-decoration: none; cursor: pointer; color: #141135; }
a.card-link:hover { color: #141135; }
a.card-link:hover h3 { color: #5b52f4; }
.card h3 { margin-bottom: 0.5rem; font-size: 1rem; transition: color 0.2s; color: #141135; font-weight: 700; }
.card h3 a { color: #141135; }
.card h3 a:hover { color: #5b52f4; }
.card p { color: #6d7097; font-size: 0.85rem; }
.card .count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.08));
    color: #5b52f4;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

/* ── Tide Table ── */
.tide-table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--gray-200);
}
.tide-table { width: 100%; border-collapse: collapse; }
.tide-table th, .tide-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.tide-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tide-table tr:last-child td { border-bottom: none; }
.tide-table tr:hover td { background: var(--gray-50); }

.tide-high { color: var(--primary); font-weight: 700; }
.tide-low { color: var(--accent); font-weight: 600; }
.coef-high { background: #fef3c7; color: #92400e; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.85rem; }
.coef-low { background: #d1fae5; color: #074eb2; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }

/* ── Date Navigation ── */
.date-nav { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.date-nav::-webkit-scrollbar { display: none; }
.date-btn {
    display: flex; flex-direction: column; align-items: center;
    padding: 0.75rem 1rem; min-width: 56px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-700);
    transition: all var(--transition);
    flex-shrink: 0;
}
.date-btn:hover { border-color: var(--primary); color: var(--primary); }
.date-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.date-btn .day { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; }
.date-btn .date { font-size: 1.15rem; font-weight: 800; }

/* ── Ephemeride ── */
.ephemeride-card {
    display: flex; gap: 2rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
    border: 1px solid var(--gray-200);
}
.ephemeride-item { display: flex; align-items: center; gap: 0.75rem; }
.ephemeride-icon { font-size: 1.25rem; }
.ephemeride-label { color: var(--gray-500); font-size: 0.8rem; }
.ephemeride-value { font-weight: 700; font-size: 0.95rem; }

/* ── Content Section ── */
.content-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 1.5rem 0;
    border: 1px solid var(--gray-200);
}
.content-section h2 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--dark); }
.content-section p { color: var(--gray-700); margin-bottom: 0.75rem; font-size: 0.95rem; line-height: 1.7; }

/* Activities */
.activities-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.activities-col h3 { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--primary); font-weight: 700; }
.activity-item { margin-bottom: 0.75rem; }
.activity-item strong { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.activity-item p { color: var(--gray-500); font-size: 0.85rem; margin: 0; }

/* ── Footer ── */
.footer {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}
.footer-brand .logo { color: var(--white); margin-bottom: 0.75rem; font-size: 1.1rem; }
.footer-brand .logo svg { color: var(--primary-light); }
.footer-brand p { font-size: 0.85rem; color: var(--gray-400); line-height: 1.6; }
.footer-links h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--gray-400); font-size: 0.85rem; }
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom {
    border-top: 1px solid rgba(148,163,184,0.15);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); }

/* ── 404 ── */
.error-page { text-align: center; padding: 5rem 1.25rem; }
.error-page h1 { font-size: 5rem; color: var(--primary); margin-bottom: 1rem; font-weight: 800; }
.error-page p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* ── Popular Cities Grid ── */
.popular-cities-section { padding-top: 2.5rem; }
.popular-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.popular-city-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1.1rem 1.3rem;
    border-radius: 14px;
    border: 1px solid #e6e7f2;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    color: #141135;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.popular-city-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #5b52f4, #5d7cf9);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}
.popular-city-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(37,99,235,0.12), 0 4px 12px rgba(15,23,42,0.06);
    border-color: rgba(37,99,235,0.25);
    color: #141135;
}
.popular-city-card:hover::before { opacity: 1; }
.country-flag {
    flex-shrink: 0;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4fa;
    border-radius: 10px;
    transition: all 0.3s;
}
.popular-city-card:hover .country-flag {
    background: rgba(37,99,235,0.08);
}
.country-flag .fi { font-size: 1.3em; }
.popular-city-info { display: flex; flex-direction: column; min-width: 0; gap: 0.15rem; }
.popular-city-name { font-weight: 700; font-size: 0.95rem; color: #141135; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.popular-city-card:hover .popular-city-name { color: #5b52f4; }
.popular-city-region { font-size: 0.8rem; color: #9d9fbf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Country Flags (flag-icons) ── */
.fi { font-size: 1.2em; vertical-align: middle; }
.fi.flag-lg { font-size: 1.8em; }
.country-flag-lg {
    flex-shrink: 0; line-height: 1;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4fa;
    border-radius: 12px;
    transition: all 0.3s;
}
.country-card-featured:hover .country-flag-lg {
    background: rgba(37,99,235,0.08);
    transform: scale(1.05);
}

/* ── Top Countries Grid ── */
.top-countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.country-card-featured {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1.25rem 1.4rem;
    border-radius: 14px;
    border: 1px solid #e6e7f2;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    color: #141135;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.country-card-featured::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    font-size: 0.7rem;
    color: #d1d3e5;
    transition: all 0.3s;
}
.country-card-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(37,99,235,0.12), 0 4px 12px rgba(15,23,42,0.06);
    border-color: rgba(37,99,235,0.25);
    color: #141135;
}
.country-card-featured:hover::after {
    color: #5b52f4;
    transform: translateY(-50%) translateX(3px);
}
.country-card-info { display: flex; flex-direction: column; min-width: 0; gap: 0.25rem; }
.country-card-name { font-weight: 700; font-size: 1rem; color: #141135; transition: color 0.2s; }
.country-card-featured:hover .country-card-name { color: #5b52f4; }
.country-card-featured .count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.08));
    color: #5b52f4;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    width: fit-content;
}

/* ── Features Grid ── */
.features-section { background: #f9fafd; border-top: 1px solid #e6e7f2; border-bottom: 1px solid #e6e7f2; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.feature-card {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    border-radius: 16px;
    background: white;
    border: 1px solid #e6e7f2;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 50px; height: 3px;
    background: linear-gradient(90deg, #5b52f4, #5d7cf9);
    border-radius: 0 0 3px 3px;
    opacity: 0;
    transition: all 0.3s;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(37,99,235,0.1), 0 4px 12px rgba(15,23,42,0.05);
    border-color: rgba(37,99,235,0.2);
}
.feature-card:hover::before { opacity: 1; width: 80px; }
.feature-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #5b52f4, #5d7cf9);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(37,99,235,0.25);
    transition: transform 0.3s;
}
.feature-card:hover .feature-icon { transform: scale(1.08); }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: #141135; }
.feature-card p { font-size: 0.9rem; color: #6d7097; line-height: 1.6; }

/* ── All Countries by Continent ── */
.continent-group { margin-bottom: 2rem; }
.continent-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #141135;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e6e7f2;
}
.countries-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.country-compact-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3a3c63;
    transition: all 0.25s;
    cursor: pointer;
}
.country-compact-card:hover {
    background: #f3f4fa;
    color: #5b52f4;
}

/* ── E-E-A-T About Data ── */
.about-data {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #e6e7f2;
    border-left: 4px solid #5b52f4;
}
.about-data h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #141135;
}
.about-data p {
    color: #4e5175;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ── E-E-A-T Detail Grid ── */
.eeat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}
.eeat-card {
    background: white;
    border-radius: 14px;
    padding: 1.75rem;
    border: 1px solid #e6e7f2;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
}
.eeat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #5b52f4, #5d7cf9);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}
.eeat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(37,99,235,0.1), 0 4px 12px rgba(15,23,42,0.05);
    border-color: rgba(37,99,235,0.2);
}
.eeat-card:hover::before { opacity: 1; }
.eeat-icon {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, #5b52f4, #5d7cf9);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 16px rgba(37,99,235,0.2);
    transition: transform 0.3s;
}
.eeat-card:hover .eeat-icon { transform: scale(1.08); }
.eeat-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; color: #141135; }
.eeat-card p { font-size: 0.85rem; color: #6d7097; line-height: 1.7; }

/* ── FAQ Section ── */
.faq-list { max-width: 800px; }
.faq-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gray-900);
    transition: background var(--transition);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--gray-400);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-item[open] summary::after {
    content: '\2212';
}
.faq-item summary:hover { background: var(--gray-50); }
.faq-item[open] summary { border-bottom: 1px solid var(--gray-200); }
.faq-answer {
    padding: 1rem 1.25rem;
}
.faq-answer p {
    color: var(--gray-700);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ── Blog ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
    color: var(--gray-900);
    cursor: pointer;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); color: var(--gray-900); }
.blog-card-image {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    background-size: cover;
    background-position: center;
}
.blog-card-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(255,255,255,0.3);
}
.blog-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-date { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.5rem; }
.blog-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--gray-500); line-height: 1.6; flex: 1; }
.blog-read-more { font-size: 0.85rem; font-weight: 600; color: var(--primary); margin-top: 0.75rem; }

/* Article page */
.article-page .container { max-width: 800px; }
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2rem; font-weight: 800; line-height: 1.3; margin-bottom: 0.75rem; }
.article-meta { display: flex; gap: 1.5rem; color: var(--gray-400); font-size: 0.85rem; }
.article-author { font-weight: 600; }
.article-content h2 { font-size: 1.3rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: var(--dark); }
.article-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: var(--dark); }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: 0.75rem 0 1rem 1.5rem; }
.article-content li { margin-bottom: 0.5rem; font-size: 0.95rem; line-height: 1.7; color: var(--gray-700); }
.article-back { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--dark);
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        gap: 0.25rem;
        z-index: 1020;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    }
    .nav.active { display: flex; }
    .nav a {
        padding: 0.85rem 1rem;
        border-radius: 8px;
        font-size: 1rem;
        color: var(--white);
        transition: background 0.2s;
    }
    .nav a:hover { background: rgba(255,255,255,0.1); }
    .nav .lang-selector { margin-top: 1rem; }
    .nav .lang-btn {
        width: 100%;
        padding: 0.85rem 1rem;
        border-radius: 8px;
        font-size: 1rem;
        color: var(--white);
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.15);
        cursor: pointer;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .nav .lang-btn::after { content: '▾'; font-size: 0.75rem; opacity: 0.7; }
    .nav .lang-btn:hover { background: rgba(255,255,255,0.15); }
    .nav .lang-dropdown {
        position: static;
        display: none;
        padding-top: 0.25rem;
        min-width: 0;
    }
    .nav .lang-selector.open .lang-dropdown { display: block; }
    .nav .lang-dropdown-inner {
        display: flex;
        flex-direction: column;
        background: rgba(255,255,255,0.08);
        border-radius: 8px;
        box-shadow: none;
        overflow: hidden;
    }
    .nav .lang-dropdown a {
        color: var(--white) !important;
        background: transparent;
        padding: 0.65rem 1.25rem;
        border-radius: 0;
        font-size: 0.95rem;
    }
    .nav .lang-dropdown a:hover { background: rgba(255,255,255,0.1); }
    .nav .lang-dropdown a.active { background: var(--primary); }
    .mobile-menu-btn {
        display: block;
        z-index: 1030;
        position: fixed;
        top: 18px;
        right: 1.25rem;
    }
    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .hero { padding: 3rem 0 2.5rem; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .hero-stat .num { font-size: 1.5rem; }
    .page-header h1 { font-size: 1.5rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .tide-table { font-size: 0.85rem; }
    .tide-table th, .tide-table td { padding: 0.5rem 0.75rem; }
    .activities-grid { grid-template-columns: 1fr; }
    .ephemeride-card { flex-direction: column; gap: 1rem; }
    .date-nav { overflow-x: auto; padding-bottom: 0.5rem; }
    .search-container { margin: 0 1rem; }
    .popular-cities-grid { grid-template-columns: 1fr; }
    .top-countries-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .features-grid { grid-template-columns: 1fr; gap: 1rem; }
    .countries-compact-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .about-data { padding: 1.5rem; }
    .eeat-grid { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.5rem; }
    /* =========================================
       CITY PAGE — COMPLETE MOBILE REDESIGN
       App-like native feel, prominent data
       ========================================= */

    /* Breadcrumb — compact, scrollable */
    .breadcrumb { padding: 0.5rem 0; }
    .breadcrumb-list {
        font-size: 0.75rem; overflow-x: auto; white-space: nowrap;
        scrollbar-width: none; flex-wrap: nowrap;
    }
    .breadcrumb-list::-webkit-scrollbar { display: none; }

    /* Hero — compact but impactful */
    .city-hero { padding: 1rem 0 1.25rem; }
    .city-hero .container {
        flex-direction: row; align-items: center;
        justify-content: space-between; gap: 0.5rem;
    }
    .city-hero-content h1 { font-size: 1.35rem; letter-spacing: -0.3px; margin-bottom: 0.15rem; }
    .city-hero-location { font-size: 0.75rem; gap: 0.35rem; }
    .city-coords { display: none; }
    .city-hero-weather { text-align: right; flex-shrink: 0; }
    .current-temp { font-size: 1.5rem; gap: 0.35rem; justify-content: flex-end; }
    .current-temp i { font-size: 1.1rem; }
    .current-condition { font-size: 0.72rem; text-align: right; }

    /* Layout */
    .city-layout { padding: 0.75rem 0 2rem; }
    .city-section { margin-bottom: 1.5rem; }
    .city-section-title { font-size: 0.95rem; margin-bottom: 0.75rem; gap: 0.4rem; }
    .city-section-title i { font-size: 0.85rem; }
    .city-section-date { font-size: 0.82rem; margin: -0.5rem 0 0.75rem; padding-left: 1.3rem; }

    /* ── NOW BAR — The star of the page ── */
    .now-bar {
        flex-direction: column; gap: 0; padding: 0;
        border-left: none; border-radius: var(--radius);
        overflow: hidden; margin-bottom: 1rem;
        box-shadow: 0 4px 16px rgba(37,99,235,0.15);
        border: 2px solid var(--primary);
    }
    .now-bar-state {
        width: 100%; padding: 1rem 1rem 0.75rem;
        background: linear-gradient(135deg, #f3f4ff 0%, #e5e7ff 100%);
    }
    .now-gauge {
        height: 10px; border-radius: 5px; margin-bottom: 0.75rem;
        background: rgba(37,99,235,0.12);
    }
    .now-gauge-fill { border-radius: 5px; }
    .now-gauge-marker {
        width: 18px; height: 18px;
        border-width: 3px;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
    }
    .now-labels { font-size: 0.8rem; }
    .now-label-from, .now-label-to { font-size: 0.75rem; }
    .now-label-from strong, .now-label-to strong { font-size: 0.9rem; display: block; }
    .now-label-current {
        font-size: 1rem; font-weight: 800;
        background: var(--primary); color: var(--white) !important;
        padding: 0.2rem 0.65rem; border-radius: 20px;
        font-size: 0.8rem;
    }
    .now-label-current i { color: var(--white); }
    .now-bar-countdown {
        border-left: none; padding-left: 0;
        display: flex; align-items: center; justify-content: center;
        gap: 0.6rem; padding: 0.6rem 1rem;
        background: var(--white); min-width: 0;
        border-top: 2px solid var(--gray-100);
    }
    .now-countdown-label {
        font-size: 0.75rem; color: var(--gray-500);
        font-weight: 500;
    }
    .now-countdown-value {
        font-size: 1.1rem; font-weight: 800;
        color: var(--primary); margin-top: 0;
        background: #f3f4ff; padding: 0.2rem 0.75rem;
        border-radius: 8px; letter-spacing: 0.5px;
    }

    /* ── DATE NAV — Bigger touch targets ── */
    .date-nav {
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        margin: 0; padding: 0 0 0.75rem;
        scrollbar-width: none; gap: 0.4rem;
    }
    .date-nav::-webkit-scrollbar { display: none; }
    .date-nav .date-btn {
        scroll-snap-align: start;
        min-width: 64px; padding: 0.6rem 0.5rem;
        border-radius: 12px;
    }
    .date-btn .day { font-size: 0.7rem; font-weight: 700; }
    .date-btn .date { font-size: 1.25rem; font-weight: 800; }
    .date-btn .month { font-size: 0.6rem; }
    .date-btn.active {
        box-shadow: 0 4px 12px rgba(37,99,235,0.3);
        transform: scale(1.02);
    }

    /* ── TIDE CARDS — Big and prominent ── */
    .tide-cards-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
    .tide-card {
        padding: 0.75rem 0.65rem; gap: 0.5rem;
        border-radius: 12px; border-left-width: 4px;
    }
    .tide-card-icon { width: 32px; height: 32px; font-size: 0.8rem; }
    .tide-card-type { font-size: 0.62rem; letter-spacing: 0.5px; }
    .tide-card-time { font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
    .tide-card-height { font-size: 0.82rem; font-weight: 700; }
    .tide-card-coef { font-size: 0.7rem; margin-top: 0.15rem; }

    /* ── TIDE CHART — contained with margin ── */
    .tide-chart-container {
        margin: 0; padding: 0.5rem;
        border-radius: var(--radius-sm);
    }

    /* ── CONDITIONS — 2-col grid, compact cards ── */
    .conditions-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.5rem; }
    .cond-card { border-radius: 12px; }
    .cond-card-header { padding: 0.5rem 0.75rem; font-size: 0.78rem; gap: 0.35rem; }
    .cond-card-header i { font-size: 0.85rem; }
    .cond-card-body { padding: 0.65rem 0.75rem; }
    .cond-row { font-size: 0.78rem; padding: 0.2rem 0; }
    .cond-label { font-size: 0.72rem; }
    .cond-value { font-size: 0.82rem; }
    .moon-display { flex-direction: column; gap: 0.5rem; text-align: center; padding: 0.25rem 0; }
    .moon-disc svg { width: 44px; height: 44px; }
    .moon-phase-name { font-size: 0.82rem; }
    .moon-illum { font-size: 0.72rem; }
    .sun-bar { margin-top: 0.5rem; }

    /* ── WEATHER FORECAST — Horizontal scroll carousel ── */
    .weather-forecast-grid {
        display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory; gap: 0.5rem;
        margin: 0 -1.25rem; padding: 0 1.25rem 0.5rem;
        scrollbar-width: none;
    }
    .weather-forecast-grid::-webkit-scrollbar { display: none; }
    .weather-day-card {
        scroll-snap-align: start; flex-shrink: 0;
        min-width: 100px; padding: 0.75rem 0.6rem;
        border-radius: 12px;
    }
    .weather-day-label { font-size: 0.7rem; margin-bottom: 0.35rem; }
    .weather-day-icon { font-size: 1.3rem; margin-bottom: 0.35rem; }
    .weather-day-temp { font-size: 0.88rem; }
    .weather-day-detail { font-size: 0.72rem; }

    /* ── RAIN RADAR — Full bleed ── */
    .rain-radar-widget { margin: 0 -1.25rem; border-radius: 0; border-left: none; border-right: none; }
    .rain-radar-map { height: 280px; }

    /* ── 10-DAY TABLE — Hidden on mobile, replaced by cards ── */
    .tide-table-desktop { display: none !important; }
    .tide-10d-cards { display: flex; flex-direction: column; gap: 0.5rem; }

    /* ── LOCATION INFO — single column, horizontal rows ── */
    .location-info-grid { grid-template-columns: 1fr; gap: 0.4rem; }
    .location-info-item {
        padding: 0.65rem 0.85rem; flex-direction: row; align-items: center;
        gap: 0.6rem; border-radius: 10px;
    }
    .location-info-item i { font-size: 0.85rem; width: 20px; text-align: center; flex-shrink: 0; }
    .moon-emoji-sm { flex-shrink: 0; }
    .location-info-label { font-size: 0.78rem; }
    .location-info-value { margin-left: auto; font-size: 0.85rem; text-align: right; }

    /* ── ACTIVITY CARDS ── */
    .activity-cards-grid { grid-template-columns: 1fr; gap: 0.6rem; }
    .activity-card { padding: 1rem; border-radius: 12px; }
    .activity-card h3 { font-size: 0.88rem; }
    .activity-card-icon { width: 28px; height: 28px; font-size: 0.75rem; margin-bottom: 0.5rem; }
    .activity-item strong { font-size: 0.85rem; }
    .activity-item p { font-size: 0.8rem; line-height: 1.5; }
    .city-section-intro { font-size: 0.85rem; }

    /* ── NEARBY CITIES — Horizontal scroll ── */
    .nearby-grid {
        display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory; gap: 0.5rem;
        margin: 0 -1.25rem; padding: 0 1.25rem 0.5rem;
        scrollbar-width: none;
    }
    .nearby-grid::-webkit-scrollbar { display: none; }
    .nearby-card {
        scroll-snap-align: start; flex-shrink: 0;
        min-width: 180px; padding: 0.75rem 0.85rem;
        border-radius: 10px; flex-direction: column;
        align-items: flex-start; gap: 0.25rem;
    }
    .nearby-name { font-size: 0.85rem; }
    .nearby-dist { font-size: 0.72rem; }

    /* ── SEO CONTENT ── */
    .city-seo {
        padding: 1.25rem; margin: 0 -1.25rem;
        border-radius: 0; border-left: none; border-right: none;
    }
    .city-seo h2 { font-size: 1rem; }
    .city-seo p { font-size: 0.85rem; line-height: 1.65; }

    /* ── API CTA — Full-width banner ── */
    .city-api-cta {
        flex-direction: column; text-align: center;
        padding: 1.25rem 1rem; gap: 0.75rem;
        margin: 1.25rem -1.25rem 0; border-radius: 0;
    }
    .city-api-cta h3 { font-size: 0.95rem; }
    .city-api-cta p { font-size: 0.8rem; }
    .city-api-cta .btn { width: 100%; text-align: center; padding: 0.75rem; }

    /* ── HOMEPAGE ── */
    .home-dual-grid { grid-template-columns: 1fr; }
    .home-api-section .home-api-grid { grid-template-columns: 1fr; }
}

/* ── Extra small screens (< 380px) ── */
@media (max-width: 380px) {
    .city-hero-content h1 { font-size: 1.15rem; }
    .city-hero-location { font-size: 0.7rem; }
    .current-temp { font-size: 1.3rem; }
    .now-countdown-value { font-size: 1.2rem; }
    .now-label-current { font-size: 0.72rem; padding: 0.15rem 0.5rem; }
    .tide-cards-row { grid-template-columns: 1fr 1fr; }
    .tide-card-time { font-size: 1.05rem; }
    .tide-card-icon { width: 26px; height: 26px; font-size: 0.7rem; }
    .conditions-grid { grid-template-columns: 1fr; }
    .location-info-grid { grid-template-columns: 1fr; }
    .date-nav .date-btn { min-width: 56px; padding: 0.5rem 0.4rem; }
    .date-btn .date { font-size: 1.1rem; }
    .weather-day-card { min-width: 88px; }
    .tide-day-entry { min-width: 0; }
    .tide-day-tides { gap: 0.3rem; }
}

/* ====================================================
   CITY PAGE — Enhanced Station View
   ==================================================== */

/* City Hero */
.city-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 60%, var(--accent) 100%);
    color: var(--white);
    padding: 2rem 0;
}
.city-hero .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.city-hero-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}
.city-hero-location {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.city-coords {
    background: rgba(255,255,255,0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}
.city-hero-weather {
    text-align: right;
}
.current-temp {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}
.current-temp i { font-size: 1.5rem; opacity: 0.9; }
.current-condition {
    font-size: 0.85rem;
    opacity: 0.75;
    display: block;
}

/* City Layout */
.city-layout { padding: 1.5rem 0 3rem; }

/* City Sections */
.city-section {
    margin-bottom: 2rem;
}
.city-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.city-section-title i {
    color: var(--primary);
    font-size: 1rem;
}
.city-section-date {
    font-size: 0.88rem;
    color: var(--gray-500);
    margin: -0.65rem 0 1rem;
    padding-left: 1.5rem;
    font-weight: 500;
}
.city-section-intro {
    color: var(--gray-700);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Now Bar */
.now-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
}
.now-bar-state { flex: 1; }
.now-gauge {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    position: relative;
    margin-bottom: 0.75rem;
    overflow: visible;
}
.now-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-light));
    border-radius: 4px;
    transition: width 0.5s;
}
.now-gauge-marker {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 3px solid var(--white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px var(--primary);
}
.now-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}
.now-label-from, .now-label-to {
    color: var(--gray-500);
    font-size: 0.78rem;
}
.now-label-from strong, .now-label-to strong {
    display: block;
    color: var(--gray-900);
    font-size: 0.9rem;
}
.now-label-from small, .now-label-to small { color: var(--gray-400); }
.now-label-current {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.now-bar-countdown {
    text-align: center;
    border-left: 1px solid var(--gray-200);
    padding-left: 1.5rem;
    min-width: 100px;
}
.now-countdown-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.now-countdown-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.15rem;
}

/* Date Nav update */
.date-btn .month {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Tide Cards Row */
.tide-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}
.tide-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}
.tide-card-high { border-left: 3px solid var(--primary); }
.tide-card-low { border-left: 3px solid var(--accent-light); }
.tide-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.tide-card-high .tide-card-icon { background: #f3f4ff; color: var(--primary); }
.tide-card-low .tide-card-icon { background: #f5f7ff; color: var(--accent); }
.tide-card-info { display: flex; flex-direction: column; gap: 0.1rem; }
.tide-card-type { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; color: var(--gray-500); letter-spacing: 0.3px; }
.tide-card-time { font-size: 1.25rem; font-weight: 800; color: var(--gray-900); }
.tide-card-height { font-size: 0.85rem; color: var(--gray-500); font-weight: 600; }
.tide-card-coef {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    width: fit-content;
}

/* Tide Chart */
.tide-chart-container {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 1rem;
    overflow: hidden;
}
.tide-chart-container canvas {
    width: 100%;
    display: block;
}

/* Conditions Grid */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.cond-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.cond-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-700);
}
.cond-card-header i { color: var(--primary); }
.moon-emoji { font-size: 1.1rem; }
.cond-card-body { padding: 1rem; }
.cond-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
}
.cond-row + .cond-row { border-top: 1px solid var(--gray-100); }
.cond-label { color: var(--gray-500); }
.cond-value { font-weight: 600; color: var(--gray-900); }

/* Sun bar */
.sun-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}
.sun-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 3px;
}

/* Moon display */
.moon-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}
.moon-phase-name { display: block; font-weight: 700; font-size: 0.95rem; color: var(--gray-900); }
.moon-illum { display: block; font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }

/* Sea state colors */
.sea-state-calm { color: #1d81fd; }
.sea-state-smooth { color: #1040ec; }
.sea-state-slight { color: #3974ff; }
.sea-state-moderate { color: #d97706; }
.sea-state-rough { color: #dc2626; }
.sea-state-very_rough { color: #991b1b; }

/* Weather Forecast Grid */
.weather-forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}
.weather-day-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: all var(--transition);
}
.weather-day-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.weather-today { border-color: var(--primary); background: #f3f4ff; }
.weather-day-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.weather-today .weather-day-label { color: var(--primary); }
.weather-day-icon {
    font-size: 1.5rem;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
}
.weather-day-temp {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.weather-day-temp strong { color: var(--gray-900); }
.weather-day-temp small { color: var(--gray-400); margin-left: 0.25rem; }
.weather-day-detail {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
}
.weather-day-detail i { color: var(--gray-400); width: 14px; text-align: center; }

/* Table enhancements */
.row-today td { background: #f3f4ff !important; }
.badge-today {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.35rem;
    text-transform: uppercase;
}
.table-weather {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--gray-700);
}
.table-weather i { color: var(--accent); }

/* Location Info Grid update */
.location-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.location-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}
.location-info-item i { color: var(--primary); font-size: 1rem; width: 20px; text-align: center; }
.moon-emoji-sm { font-size: 1.1rem; width: 20px; text-align: center; }
.location-info-label { font-size: 0.78rem; color: var(--gray-500); }
.location-info-value { font-weight: 600; font-size: 0.9rem; color: var(--gray-900); margin-left: auto; }

/* Activity Cards */
.activity-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.activity-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.activity-card-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.activity-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* Nearby Grid */
.nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}
.nearby-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    color: var(--gray-900);
    transition: all var(--transition);
}
.nearby-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    color: var(--gray-900);
}
.nearby-name { font-weight: 600; font-size: 0.9rem; }
.nearby-dist { font-size: 0.78rem; color: var(--gray-500); }
.nearby-dist i { color: var(--gray-400); margin-right: 0.25rem; }

/* SEO Content */
.city-seo {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.city-seo h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; color: var(--dark); }
.city-seo p { color: var(--gray-700); font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.75rem; }

/* API CTA */
.city-api-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
}
.city-api-cta h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.city-api-cta h3 i { margin-right: 0.25rem; }
.city-api-cta p { font-size: 0.85rem; opacity: 0.8; margin: 0; }
.city-api-cta .btn {
    background: var(--white);
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}
.city-api-cta .btn:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}

/* ====================================================
   HOMEPAGE — Dual audience (Public + Developers)
   ==================================================== */

/* Home dual grid */
.home-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}
.home-audience-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
}
.home-audience-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.home-audience-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.5rem;
    color: var(--white);
}
.home-audience-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}
.home-audience-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.home-audience-card .btn { font-size: 0.85rem; }

/* Home API section */
.home-api-section {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3.5rem 0;
}
.home-api-section .section-title { color: var(--white); }
.home-api-section p.section-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    max-width: 600px;
    margin: -1rem auto 2rem;
    text-align: center;
    line-height: 1.6;
}
.home-api-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.home-api-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}
.home-api-card:hover { background: rgba(255,255,255,0.12); }
.home-api-card i {
    font-size: 1.5rem;
    color: var(--accent-light);
    margin-bottom: 0.75rem;
    display: block;
}
.home-api-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.home-api-card p {
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1.5;
}
.home-api-cta {
    text-align: center;
}
.home-api-cta .btn {
    background: var(--white);
    color: var(--primary);
}
.home-api-cta .btn:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}
.home-api-cta small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ── 10-Day Mobile Cards (hidden on desktop) ── */
.tide-10d-cards { display: none; }
.tide-day-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.tide-day-today { border-color: var(--primary); border-width: 2px; }
.tide-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}
.tide-day-today .tide-day-header { background: #f3f4ff; }
.tide-day-date {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tide-day-weather {
    font-size: 0.85rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.tide-day-weather i { color: var(--accent); }
.tide-day-tides {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem;
}
.tide-day-entry {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    flex: 1;
    min-width: calc(50% - 0.25rem);
}
.entry-high {
    background: #f3f4ff;
    color: var(--primary);
}
.entry-low {
    background: #f5f7ff;
    color: var(--accent);
}
.tide-day-entry i { font-size: 0.65rem; flex-shrink: 0; }
.entry-time { font-weight: 800; font-size: 0.9rem; }
.entry-height { font-size: 0.78rem; opacity: 0.75; font-weight: 600; }
.tide-day-coef {
    padding: 0.35rem 0.85rem 0.55rem;
    font-size: 0.78rem;
    color: var(--gray-600);
}

/* ── Rain Radar Widget ── */
.rain-radar-widget {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: var(--white);
}
.rain-radar-map {
    height: 350px;
    width: 100%;
    background: #e6e7f2;
}
.radar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}
.radar-play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}
.radar-play-btn:hover { background: var(--primary-dark); }
.radar-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-200);
    border-radius: 2px;
    outline: none;
}
.radar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.radar-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.radar-time {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    background: var(--gray-100);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}
.radar-time.radar-nowcast {
    background: #e5e7ff;
    color: var(--primary-dark);
}
.radar-live-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #dc2626;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: radar-pulse 2s infinite;
}
@keyframes radar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@media (max-width: 640px) {
    .rain-radar-map { height: 250px; }
    .radar-controls { padding: 0.5rem 0.75rem; gap: 0.5rem; }
    .radar-time { font-size: 0.72rem; padding: 0.2rem 0.45rem; }
}

/* ===========================================================
   CITY PAGE — MOBILE OVERRIDES (must come AFTER desktop styles)
   =========================================================== */
@media (max-width: 768px) {
    /* Chart: prevent canvas overflow, fit in container */
    .tide-chart-container {
        padding: 0.5rem;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    .tide-chart-container canvas {
        max-width: 100%;
        display: block;
    }

    /* Hero: keep compact */
    .city-hero { padding: 1rem 0 1.25rem; }
    .city-hero-content h1 { font-size: 1.35rem; }

    /* Now bar */
    .now-bar { padding: 0; border-left: none; }
    .now-bar-state { padding: 1rem 1rem 0.75rem; }
    .now-bar-countdown { padding: 0.6rem 1rem; border-left: none; border-top: 2px solid var(--gray-100); }
    .now-countdown-value { margin-top: 0; background: #f3f4ff; padding: 0.2rem 0.75rem; border-radius: 8px; }

    /* Tide cards */
    .tide-card { padding: 0.75rem 0.65rem; }

    /* Conditions */
    .cond-card-header { padding: 0.5rem 0.75rem; }
    .cond-card-body { padding: 0.65rem 0.75rem; }

    /* Location info — single column horizontal rows */
    .location-info-grid { grid-template-columns: 1fr; gap: 0.4rem; }
    .location-info-item {
        padding: 0.65rem 0.85rem; flex-direction: row; align-items: center; gap: 0.6rem;
    }
    .location-info-value { margin-left: auto; font-size: 0.85rem; }

    /* Rain radar */
    .rain-radar-map { height: 280px; }

    /* SEO */
    .city-seo { padding: 1.25rem; }

    /* Observations mobile */
    .obs-chart-legend { flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; }
    .obs-surge-bar { padding: 0.5rem 0.75rem; }
}

/* ================================================
   REFMAR Observations — LIVE badge, chart legend, surge bar
   ================================================ */

/* LIVE badge */
.obs-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
}
.obs-live-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: obs-pulse 1.5s ease-in-out infinite;
}
@keyframes obs-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Chart legend */
.obs-chart-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: -0.25rem 0 0.75rem;
    font-size: 0.8rem;
    color: #6d7097;
}
.obs-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.obs-legend-swatch {
    width: 16px;
    height: 3px;
    border-radius: 2px;
    display: inline-block;
}

/* Surge/décote bar */
.obs-surge-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9fafd;
    border: 1px solid #e6e7f2;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.obs-surge {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.obs-surge-positive { color: #16a34a; }
.obs-surge-negative { color: #dc2626; }
.obs-surge-neutral { color: #6d7097; }
.obs-surge-source {
    margin-left: auto;
    color: #9d9fbf;
    font-size: 0.75rem;
}
