/* ============================================================
   Nauti-Connect — Custom Styles
   Sky (#1a85c8) / Ocean (#0a58a0) / Gold (#c9a227)
   ============================================================ */

/* Base */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(175deg, #1a85c8 0%, #1070b0 28%, #0a58a0 58%, #074880 100%);
    background-attachment: fixed;
    color: #e8eef5;
    min-height: 100vh;
}

/* ============================================================
   Semi-transparent section & layout overrides
   (allows the bright gradient background to show through)

   NOTE: !important is required here because Tailwind CDN
   dynamically injects its utility class styles via JavaScript
   *after* this stylesheet is parsed, giving Tailwind's rules
   the same or higher cascade order. Without !important our
   transparent overrides would be silently ignored.
   ============================================================ */

/* Nav bar */
nav.sticky,
nav {
    background-color: rgba(5, 30, 70, 0.92) !important;
}

/* Common section background colours used across pages */
.bg-\[\#0a1628\],
.bg-\[\#0f2340\],
.bg-\[\#112644\] {
    background-color: rgba(10, 55, 110, 0.72) !important;
}

/* Wave-transition SVG dividers — match semi-transparent sections */
svg[aria-hidden="true"] > path[fill="#0f2340"],
svg[aria-hidden="true"] > path[fill="#0a1628"] {
    fill: rgba(8, 45, 95, 0.82) !important;
}

/* Mobile nav dropdown */
#mobile-menu {
    background-color: rgba(5, 35, 80, 0.96) !important;
}

/* ============================================================
   Glassmorphism Cards  (bright / more transparent)
   ============================================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 0.75rem;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.22);
}

/* ============================================================
   Hero section canvas — hidden; kept for legacy compatibility
   ============================================================ */
.ocean-canvas { display: none; }

/* ============================================================
   Navigation
   ============================================================ */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d6e4f0;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}
.nav-link:hover,
.nav-link.active {
    color: #f0d060;
    background-color: rgba(201, 162, 39, 0.14);
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 0.75rem;
    border-radius: 0.5rem;
    color: #d1dce8;
    text-decoration: none;
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: color 0.2s, background-color 0.2s;
}
.mobile-nav-link:hover {
    color: #f0d060;
    background-color: rgba(201, 162, 39, 0.08);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4a820 0%, #c9a227 60%, #b8911f 100%);
    color: #0a1628;
    font-weight: 700;
    border-radius: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 2px 14px rgba(201, 162, 39, 0.40);
}
.btn-gold:hover {
    filter: brightness(1.14);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(201, 162, 39, 0.50);
}
.btn-gold:active { transform: translateY(0); filter: brightness(1); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: #f0d060;
    font-weight: 600;
    border: 1.5px solid rgba(201, 162, 39, 0.65);
    border-radius: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    padding: 0.5rem 1.25rem;
}
.btn-outline:hover {
    background-color: rgba(201, 162, 39, 0.18);
    border-color: #f0d060;
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.24);
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(201, 162, 39, 0.28);
    border-radius: 0.625rem;
    color: #e2e8f0;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    outline: none;
}
.form-input:focus {
    border-color: #c9a227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}
.form-input::placeholder { color: #b8cfea; }
.form-input option { background: #0a3a70; }

/* ============================================================
   Filter Buttons
   ============================================================ */
.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(201, 162, 39, 0.22);
    color: #cce0f5;
    text-decoration: none;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: #c9a227; color: #c9a227; }
.filter-btn.active {
    background: rgba(201, 162, 39, 0.18);
    border-color: #c9a227;
    color: #c9a227;
    font-weight: 700;
}

/* ============================================================
   Map
   ============================================================ */
.map-container { height: 500px; }

@media (max-width: 640px) {
    .map-container { height: 320px; }
}

.leaflet-popup-content-wrapper {
    background: rgba(8, 50, 100, 0.94) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(201, 162, 39, 0.3) !important;
    border-radius: 0.75rem !important;
}
.leaflet-popup-tip { background: rgba(8, 50, 100, 0.94) !important; }
.leaflet-popup-content a { color: #c9a227; text-decoration: none; }

/* ============================================================
   Progress Bars
   ============================================================ */
.progress-bar-track {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(201, 162, 39, 0.15);
}
.progress-bar-fill {
    background: linear-gradient(90deg, #c9a227, #d4af37);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0.25rem;
}

.progress-slider {
    -webkit-appearance: none;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    outline: none;
    cursor: pointer;
}
.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #c9a227;
    cursor: pointer;
    border: 2px solid #0a1628;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.4);
}

/* ============================================================
   Wave Animations
   ============================================================ */
.wave-animate {
    animation: wave-drift 6s ease-in-out infinite;
}
@keyframes wave-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-20px); }
}

.wave-container {
    line-height: 0;
    overflow: hidden;
}
.wave-container svg { display: block; }

/* ============================================================
   Sighting Recent Highlight
   ============================================================ */
.sighting-recent {
    animation: sighting-pulse 3s ease-in-out infinite;
}
@keyframes sighting-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
    50% { box-shadow: 0 0 12px 4px rgba(201, 162, 39, 0.18); }
}

/* ============================================================
   Flash Messages
   ============================================================ */
.flash-message {
    animation: slide-in 0.4s ease-out;
}
@keyframes slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Image preview grid
   ============================================================ */
.img-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(201, 162, 39, 0.25);
}
.img-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   Utility
   ============================================================ */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10, 55, 110, 0.50); }
::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.45); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 39, 0.70); }

/* ============================================================
   Auth Modal
   ============================================================ */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 25, 60, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.auth-modal-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.auth-modal-box {
    width: 100%;
    max-width: 26rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    background: rgba(10, 55, 110, 0.88);
    border: 1px solid rgba(201, 162, 39, 0.40);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 162, 39, 0.14);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    text-align: center;
    border-radius: 0.75rem;
}
.auth-modal-box form,
.auth-modal-box p,
.auth-modal-box .auth-tabs {
    text-align: left;
}
.auth-modal-overlay.is-open .auth-modal-box {
    transform: translateY(0) scale(1);
}
.auth-modal-box.register-active {
    max-width: 30rem;
}

.auth-modal-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, 0.10);
    border: 1px solid rgba(201, 162, 39, 0.28);
    border-radius: 50%;
    color: #c9a227;
    font-size: 1.125rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}
.auth-modal-close:hover {
    background: rgba(201, 162, 39, 0.25);
    color: #e8c044;
}

/* Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(201, 162, 39, 0.22);
    margin-bottom: 1.5rem;
    gap: 0;
}
.auth-tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.auth-tab:hover { color: #d1dce8; }
.auth-tab.active {
    color: #f0d060;
    border-bottom-color: #c9a227;
}

/* Panel */
.auth-panel { display: block; }
.auth-panel.hidden { display: none; }

/* Switch-tab inline link buttons inside panels */
[data-switch-tab] {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    color: #c9a227;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
[data-switch-tab]:hover { color: #f0d060; }

/* Loading spinner inside button */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}
.btn-loading::after {
    content: '';
    position: absolute;
    right: 0.875rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

