/* Bar Watch - Pacific Northwest Bar Conditions Tracker
 * Consolidated CSS for all pages
 * Ocean-themed dark design
 */

/* ============================================================================
   CSS Variables - Ocean Theme
   ============================================================================ */
:root {
    --ocean-abyss: #050d18;
    --ocean-deep: #0a1628;
    --ocean-dark: #0f2137;
    --ocean-mid: #1a365d;
    --ocean-light: #2c5282;
    --ocean-glow: #4fd1c5;
    --ocean-foam: #81e6d9;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --status-open: #48bb78;
    --status-restricted: #ecc94b;
    --status-closed: #f56565;
    --status-unknown: #a0aec0;
    --card-border: rgba(79, 209, 197, 0.1);
}

/* ============================================================================
   Base Styles
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--ocean-abyss);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 60px;
}

body.disclaimer-dismissed {
    padding-bottom: 0;
}

a {
    color: var(--ocean-glow);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--ocean-foam);
}

/* ============================================================================
   Header
   ============================================================================ */
.header {
    background: linear-gradient(180deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ocean-glow);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--ocean-foam);
}

/* ============================================================================
   Navigation
   ============================================================================ */
.nav-btn {
    padding: 0.625rem 1.25rem;
    background: var(--ocean-mid);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-btn:hover {
    background: var(--ocean-light);
    border-color: var(--ocean-glow);
    color: var(--text-primary);
}

.subscribe-btn {
    background: rgba(79, 209, 197, 0.15);
    color: var(--ocean-glow);
    border-color: rgba(79, 209, 197, 0.3);
}

.subscribe-btn:hover {
    background: rgba(79, 209, 197, 0.25);
}

.subscribe-btn.subscribed {
    background: var(--ocean-glow);
    color: var(--ocean-deep);
}

/* ============================================================================
   Main Content
   ============================================================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ============================================================================
   Cards
   ============================================================================ */
.card {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.status-card {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.status-card .status-banner {
    border-radius: 16px 16px 0 0;
}

.status-card-content {
    padding: 2rem;
}

.chart-card {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.table-card {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

/* ============================================================================
   Status Banners and Badges
   ============================================================================ */
.status-banner {
    height: 6px;
}

.status-banner.open, .status-banner.green { background: var(--status-open); }
.status-banner.restricted, .status-banner.yellow { background: var(--status-restricted); }
.status-banner.closed, .status-banner.red { background: var(--status-closed); }
.status-banner.unknown, .status-banner.gray { background: var(--status-unknown); }

.status-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.open, .status-badge.green {
    background: rgba(72, 187, 120, 0.15);
    color: var(--status-open);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-badge.restricted, .status-badge.yellow {
    background: rgba(236, 201, 75, 0.15);
    color: var(--status-restricted);
    border: 1px solid rgba(236, 201, 75, 0.3);
}

.status-badge.closed, .status-badge.red {
    background: rgba(245, 101, 101, 0.15);
    color: var(--status-closed);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.status-badge.unknown, .status-badge.gray {
    background: rgba(160, 174, 192, 0.15);
    color: var(--status-unknown);
    border: 1px solid rgba(160, 174, 192, 0.3);
}

.status-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.open {
    background: rgba(72, 187, 120, 0.15);
    color: var(--status-open);
}

.status-pill.restricted {
    background: rgba(236, 201, 75, 0.15);
    color: var(--status-restricted);
}

.status-pill.closed {
    background: rgba(245, 101, 101, 0.15);
    color: var(--status-closed);
}

.status-pill.unknown {
    background: rgba(160, 174, 192, 0.15);
    color: var(--status-unknown);
}

/* ============================================================================
   Info Boxes
   ============================================================================ */
.info-box {
    background: rgba(5, 13, 24, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.info-box h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ocean-glow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.info-box p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ============================================================================
   Data Gauges
   ============================================================================ */
.gauges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gauge-card {
    background: rgba(5, 13, 24, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.gauge-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gauge-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.gauge-value.swell { color: var(--ocean-glow); }
.gauge-value.wind { color: var(--status-open); }
.gauge-value.vis { color: var(--status-restricted); }

.gauge-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.gauge-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================================================
   Charts
   ============================================================================ */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h2 {
    margin-bottom: 0;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reset-zoom-btn {
    background: rgba(79, 209, 197, 0.15);
    border: 1px solid rgba(79, 209, 197, 0.3);
    color: var(--ocean-glow);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-zoom-btn:hover {
    background: rgba(79, 209, 197, 0.25);
    border-color: var(--ocean-glow);
}

.chart-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.chart-container {
    height: 280px;
    position: relative;
}

canvas {
    max-width: 100%;
}

/* ============================================================================
   Tables
   ============================================================================ */
.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.table-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: rgba(5, 13, 24, 0.3);
    border-bottom: 1px solid var(--card-border);
}

.history-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(79, 209, 197, 0.05);
}

.history-table tr:hover td {
    background: rgba(79, 209, 197, 0.03);
}

/* ============================================================================
   Jump Navigation Menu
   ============================================================================ */
.jump-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--ocean-deep);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 1400px;
    margin: 0 auto;
}

.jump-menu::-webkit-scrollbar {
    height: 4px;
}

.jump-menu::-webkit-scrollbar-track {
    background: transparent;
}

.jump-menu::-webkit-scrollbar-thumb {
    background: var(--ocean-mid);
    border-radius: 2px;
}

.jump-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.jump-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.jump-link {
    padding: 0.4rem 0.75rem;
    background: var(--ocean-dark);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.jump-link:hover {
    background: var(--ocean-mid);
    color: var(--ocean-glow);
    border-color: var(--ocean-glow);
}

.jump-home {
    background: var(--ocean-mid);
    border-color: var(--ocean-glow);
    color: var(--ocean-glow);
    margin-right: 0.5rem;
}

.jump-home:hover {
    background: var(--ocean-glow);
    color: var(--ocean-abyss);
}

.jump-link.active {
    background: var(--ocean-glow);
    color: var(--ocean-abyss);
    border-color: var(--ocean-glow);
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--ocean-dark);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.875rem; }
.toast-message { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.25rem; }

/* ============================================================================
   Tooltips
   ============================================================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ocean-dark);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: normal;
    max-width: 250px;
    width: max-content;
    text-align: center;
    z-index: 1000;
    border: 1px solid var(--card-border);
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   Lightbox
   ============================================================================ */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ============================================================================
   Sticky Disclaimer
   ============================================================================ */
.sticky-disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(245, 101, 101, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.75rem 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sticky-disclaimer.dismissed {
    display: none;
}

.sticky-disclaimer p {
    margin: 0;
    font-size: 0.75rem;
    color: white;
    text-align: center;
    max-width: 1000px;
}

.sticky-disclaimer strong {
    color: white;
    font-weight: 700;
}

.dismiss-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   Site Footer
   ============================================================================ */
.site-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--ocean-glow);
}

/* ============================================================================
   Scroll to Top Button
   ============================================================================ */
.scroll-top-btn {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--ocean-deep);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: var(--ocean-glow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn:hover {
    background: var(--card-bg);
    border-color: var(--ocean-glow);
    transform: translateY(-2px);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

/* Adjust position when disclaimer is visible */
body:not(.disclaimer-dismissed) .scroll-top-btn {
    bottom: 8rem;
}

/* ============================================================================
   No Data State
   ============================================================================ */
.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* ============================================================================
   Animations
   ============================================================================ */
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(72, 187, 120, 0); }
}

@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(236, 201, 75, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(236, 201, 75, 0); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 101, 101, 0); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   Custom Scrollbar
   ============================================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ocean-deep);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--ocean-mid);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ocean-light);
}

/* ============================================================================
   Responsive - Mobile
   ============================================================================ */
@media (max-width: 768px) {
    .header-nav {
        flex-wrap: wrap;
    }

    .history-table {
        font-size: 0.8125rem;
    }

    .history-table th,
    .history-table td {
        padding: 0.75rem 1rem;
    }

    .jump-menu {
        padding: 0.5rem 1rem;
    }

    .jump-label {
        display: none;
    }

    .jump-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    .gauges-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gauge-card {
        padding: 1rem;
    }

    .gauge-value {
        font-size: 1.5rem;
    }

    .status-card-content {
        padding: 1.25rem;
    }
}

/* ============================================================================
   Ocean Background
   ============================================================================ */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(79, 209, 197, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(44, 82, 130, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--ocean-abyss) 0%, var(--ocean-deep) 100%);
}

/* ============================================================================
   Development Banner
   ============================================================================ */
.dev-banner {
    background: linear-gradient(135deg, rgba(79, 209, 197, 0.15), rgba(79, 209, 197, 0.08));
    border-bottom: 1px solid rgba(79, 209, 197, 0.3);
    color: var(--ocean-glow);
    text-align: center;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.8125rem;
    position: relative;
}

.dev-banner-dismiss {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ocean-glow);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.dev-banner-dismiss:hover {
    opacity: 1;
}

/* ============================================================================
   Mobile Menu
   ============================================================================ */
.hamburger {
    display: none;
    background: rgba(79, 209, 197, 0.1);
    border: 1px solid rgba(79, 209, 197, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.hamburger:hover {
    background: rgba(79, 209, 197, 0.2);
    border-color: var(--ocean-glow);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ocean-deep);
    z-index: 2000;
    flex-direction: column;
    padding: 1.5rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-menu-close:hover {
    color: var(--ocean-glow);
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
    background: rgba(79, 209, 197, 0.15);
    border-color: rgba(79, 209, 197, 0.3);
    color: var(--ocean-glow);
}

.mobile-menu-nav svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ============================================================================
   Common Page Header
   ============================================================================ */
.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ocean-glow), var(--ocean-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Desktop nav */
.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav a {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--card-border);
}

.nav a.active {
    color: var(--ocean-glow);
    background: rgba(79, 209, 197, 0.1);
    border-color: rgba(79, 209, 197, 0.2);
}

/* Footer separator */
.footer-sep {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

/* ============================================================================
   Responsive - Show hamburger on mobile
   ============================================================================ */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav {
        display: none;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    nav, button, .fixed, .sticky-disclaimer, .toast-container, .dev-banner, .mobile-menu {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        padding-bottom: 0;
    }

    .card, .status-card, .chart-card, .table-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
