/* ==========================================================================
   VA3ODC PORTAL (portal.solosoft.ca) - THEME & STYLESHEET
   Matches https://va3odc.com colors, typography, cards, header, and footer
   ========================================================================== */

:root,
html {
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.86);
    --card-bg-solid: #1e293b;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(51, 65, 85, 0.85);
    --text: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-soft: rgba(56, 189, 248, 0.14);
    --accent-border: rgba(56, 189, 248, 0.35);
    --repeater-accent: #38bdf8;
    --online: #22c55e;
    --online-bg: rgba(34, 197, 94, 0.14);
    --online-border: rgba(34, 197, 94, 0.35);
    --offline: #ef4444;
    --offline-bg: rgba(239, 68, 68, 0.14);
    --offline-border: rgba(239, 68, 68, 0.35);
    --nav-shadow: rgba(0, 0, 0, 0.5);
    --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

html.light-mode,
body.light-mode {
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.94);
    --card-bg-solid: #ffffff;
    --border: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(203, 213, 225, 0.95);
    --text: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent: #0984e3;
    --accent-hover: #0770c2;
    --accent-soft: rgba(9, 132, 227, 0.11);
    --accent-border: rgba(9, 132, 227, 0.32);
    --repeater-accent: #0984e3;
    --nav-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

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

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

html {
    background-color: var(--bg);
    transition: background-color 0.3s ease;
    scroll-behavior: smooth;
}

body {
    background: transparent !important;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.6;
    transition: color 0.3s ease;
}

/* ==========================================================================
   TOP NAVIGATION & VA3ODC HEADER
   ========================================================================== */

.top-nav {
    width: 100%;
    max-width: 1160px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.top-nav-left,
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.back-btn,
.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg-solid);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.82rem;
    text-decoration: none;
    box-shadow: 0 2px 5px var(--nav-shadow);
    transition: all 0.2s ease;
}

.back-btn:hover,
.theme-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    filter: brightness(1.08);
}

html.light-mode .back-btn:hover,
html.light-mode .theme-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

.header-section {
    text-align: center;
    padding: 4px 20px 14px 20px;
    max-width: 820px;
    width: 100%;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
}

.site-logo {
    width: 340px;
    max-width: 72vw;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px var(--nav-shadow));
    transition: transform 0.25s ease;
}

.site-logo:hover {
    transform: scale(1.02);
}

.club-name {
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    margin-top: 6px;
    opacity: 0.95;
}

.portal-subtitle {
    margin: 10px auto 0 auto;
    max-width: 640px;
    font-size: 0.98rem;
    color: var(--text-secondary);
}

.coords-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.92rem;
    margin-top: 12px;
    opacity: 0.8;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Quick Section Jump Pills (matching va3odc.com .sub-links / .sub-btn) */
.sub-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 8px 20px 24px 20px;
    max-width: 860px;
}

.sub-btn {
    background: var(--card-bg-solid);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 5px var(--nav-shadow);
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sub-btn:hover,
.sub-btn.active {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--nav-shadow);
}

.sub-btn.active {
    background: var(--accent);
    color: #ffffff;
}

.pill-count {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.sub-btn:not(.active) .pill-count {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ==========================================================================
   PORTAL CONTENT & SECTIONS
   ========================================================================== */

.portal-main {
    width: 100%;
    max-width: 1120px;
    padding: 0 20px 36px 20px;
    display: flex;
    flex-direction: column;
    gap: 38px;
}

.portal-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-margin-top: 24px;
}

.portal-section.hidden-section {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-strong);
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px var(--nav-shadow);
}

.section-heading {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.section-caption {
    margin: 2px 0 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.section-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

/* Cards Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.sites-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    box-shadow: var(--card-shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.75;
    transition: opacity 0.22s ease;
}

.site-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-border);
    box-shadow: 0 12px 28px var(--nav-shadow);
}

.site-card:hover::before {
    opacity: 1;
}

.card-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    padding: 4px 11px;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.domain-pill:hover {
    background: var(--accent);
    color: #ffffff;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
}

.status-pill.online {
    color: var(--online);
    background: var(--online-bg);
    border-color: var(--online-border);
}

.status-pill.offline {
    color: var(--offline);
    background: var(--offline-bg);
    border-color: var(--offline-border);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.online .status-dot {
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.85);
}

.card-title {
    margin: 0;
    font-size: 1.24rem;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -0.2px;
}

.card-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: var(--accent);
}

.card-overview {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.58;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}

.feature-tag {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

html.light-mode .feature-tag {
    background: rgba(15, 23, 42, 0.04);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card-url-hint {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 12px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 3px 10px var(--nav-shadow);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.launch-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* ==========================================================================
   FOOTER (Matches https://va3odc.com)
   ========================================================================== */

.footer {
    margin-top: auto;
    width: 100%;
    padding: 28px 20px 34px 20px;
    text-align: center;
    border-top: 1px solid var(--border-strong);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.footer-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg-solid);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.84rem;
    color: var(--text);
    box-shadow: 0 2px 8px var(--nav-shadow);
    transition: all 0.2s ease;
    user-select: none;
    text-decoration: none;
    cursor: pointer;
}

.footer-counter:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--nav-shadow);
}

html.light-mode .footer-counter {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.counter-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.counter-label {
    font-weight: 600;
    opacity: 0.88;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.counter-arrow {
    font-size: 0.75rem;
    opacity: 0.65;
    margin-left: 2px;
}

.footer-copy {
    margin: 0;
    opacity: 0.68;
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 980px) {
    .sites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .sites-grid,
    .sites-grid.two-col {
        grid-template-columns: 1fr;
    }

    .top-nav {
        padding: 12px 15px;
    }

    .club-name {
        font-size: 0.92rem;
        letter-spacing: 2.2px;
    }

    .section-heading {
        font-size: 1.35rem;
    }

    .site-card {
        padding: 20px;
    }
}
