:root {
    /* Core Palette */
    --nuke-blue: #346699;
    --nuke-blue-dark: #1e3c72;
    --nuke-blue-light: #5183b6;
    --nuke-gold: #FFD700;
    --nuke-gold-dark: #ccac00;

    /* Neutral Palette */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e1e4e8;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;

    /* Typography */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-condensed: "Arial Narrow", "Helvetica Inserat", "sans-serif-condensed", sans-serif;

    /* Status Colors */
    --status-online: #27ae60;
    --status-offline: #c0392b;
    --status-reduced: #e67e22;
    --status-coastdown: #3498db;
    --status-startup: #f1c40f;
    --status-b2b: #8e44ad;

    /* Semantic Colors */
    --color-success: #27ae60;
    --color-danger: #c0392b;
    --color-warning: #f39c12;
    --color-info: #3498db;

    /* Gray Scale */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #1a2a3a;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 20px;
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-tooltip: 0 4px 12px rgba(0,0,0,0.2);

    /* Gradients */
    --gradient-blue: linear-gradient(135deg, #1a2a3a 0%, #346699 100%);
    --gradient-blue-rev: linear-gradient(135deg, #346699 0%, #1e3c72 100%);
    --gradient-hero: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #346699 100%);
    --gradient-sidebar: linear-gradient(135deg, #346699 0%, #2a5298 50%, #1e3c72 100%);
}

/* Smooth scroll for anchor jumps */
html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Typography & Links */
a {
    color: var(--nuke-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--nuke-blue-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 { color: var(--nuke-blue-dark); font-size: 2.25rem; }
h2 { color: var(--nuke-blue); font-size: 1.8rem; }
h3 { color: var(--nuke-blue); font-size: 1.5rem; }
h4 { color: var(--nuke-blue-dark); font-size: 1.25rem; }
h5 { color: #e74c3c; font-size: 1.1rem; }
h6 { color: var(--nuke-blue-dark); font-size: 1rem; }

/* Lists */
ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ul ul {
    list-style-type: circle;
}

ul ul ul {
    list-style-type: square;
}

/* Tables — only set border-collapse globally; color/padding is page-specific */
table {
    border-collapse: collapse;
}


/* --- Modern Homepage Styles (Consolidated) --- */

/* Modern Feed Styles (Forum & Jobs) */
.forum-feed, .job-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    margin: 10px 0;
    padding: 0;
}

.forum-feed .forum-item, .job-feed .job-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.forum-feed .forum-item:hover, .job-feed .job-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--nuke-blue);
}

.job-item-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
    margin-right: 6px;
    flex-shrink: 0;
}
.job-item-logo-link {
    flex-shrink: 0;
    line-height: 0;
}
.job-feed .feed-item-header .job-item-company {
    margin-right: auto;
}
a.job-item-meta {
    color: var(--text-muted) !important;
    text-decoration: none !important;
}
a.job-item-meta:hover {
    color: var(--nuke-blue) !important;
}

.forum-item-board, .job-item-company {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--nuke-blue) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.forum-item-title, .job-item-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-main) !important;
    line-height: 1.4;
    margin-bottom: 4px;
    display: block;
    text-decoration: none !important;
}

.forum-item-title {
    font-family: var(--font-condensed);
    letter-spacing: -0.2px;
}

.status-new {
    background: var(--nuke-gold);
    color: #000 !important;
    font-size: 0.75em;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 5px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    text-transform: uppercase;
}

.forum-item-title strong, .job-item-title strong {
    color: #e74c3c;
}

.forum-item-meta, .job-item-meta {
    font-size: 0.85em;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.forum-item-meta i, .job-item-meta i {
    margin-right: 5px;
    color: #bdc3c7;
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.feed-item-header .job-item-company,
.feed-item-header .forum-item-board {
    margin-bottom: 0;
}
.feed-item-header .job-item-meta,
.feed-item-header .forum-item-meta {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

@media (min-width: 1460px) {
    .forum-feed, .job-feed {
        grid-template-columns: repeat(3, 1fr);
    }
}

.forum-feed .hideOnMobile {
    display: inline;
}

@media only screen and (max-width: 1060px) {
    .forum-feed .hideOnMobile {
        display: none !important;
    }
}

.job-item-title-row {
    display: flex;
    align-items: flex-start;
}
.job-item-logo-mobile {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
.job-item-title-row .job-item-logo-link {
    margin-right: 6px;
    margin-top: 2px;
    flex-shrink: 0;
    display: none;
}
@media only screen and (max-width: 1060px) {
    .job-item-title-row .job-item-logo-link.showOnMobile {
        display: block;
    }
}

.forum-item-icon {
    flex-shrink: 0;
    margin-right: 6px;
    line-height: 0;
}
.forum-item-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-left: 3px;
}
.forum-item-poster {
    color: var(--text-muted) !important;
    text-decoration: none !important;
}
.forum-item-poster:hover {
    color: var(--nuke-blue) !important;
}
.forum-item-icon img {
    height: 18px;
    width: auto;
}
.forum-item-title-row {
    display: flex;
    align-items: flex-start;
}
.forum-item-title-row .forum-item-icon {
    margin-top: 3px;
    display: none;
}
@media only screen and (max-width: 1060px) {
    .forum-item-title-row .forum-item-icon.showOnMobile {
        display: block;
    }
}
.feed-item-header .forum-item-board {
    margin-right: auto;
}

/* Job Overflow Styles */
.job-overflow-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
    margin-right: 6px;
    flex-shrink: 0;
}
.job-overflow-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0 25px 0;
    justify-content: center;
}

.job-overflow-card {
    background: var(--bg-white);
    border: 1px solid var(--nuke-gold);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.1);
}

.job-overflow-card:hover {
    background: var(--nuke-gold);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.job-overflow-card .extra-icon {
    color: #000;
    margin-right: 10px;
    font-size: 1.1em;
}

.job-overflow-card .extra-text {
    color: #333;
    font-weight: 700;
    font-size: 0.9em;
}

.job-overflow-card:hover .extra-text {
    color: #000;
}

/* Modern Action Bar */
.top-action-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.action-card {
    background: linear-gradient(180deg, var(--nuke-blue-light) 0%, var(--nuke-blue) 100%);
    color: #ffffff !important;
    text-decoration: none;
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
}
.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #ffffff !important;
}
.action-card i {
    font-size: 2em;
    margin-bottom: 10px;
    color: #ffffff !important;
    transition: transform 0.2s ease, color 0.2s ease;
}
.action-card:hover i {
    transform: scale(1.15);
    color: var(--nuke-gold) !important;
}
.action-card span {
    font-weight: 600;
    font-size: 0.9em;
    line-height: 1.2;
    color: #ffffff !important;
}

/* Jump Nav — inherits from .nw-t2-nav in nwmenu.css */
.jump-nav {
    position: sticky;
    top: 49px;
    z-index: 900;
    transition: border-radius 0.2s ease;
}
/* Jump pill overrides — slightly more prominent links for homepage */
.jump-nav.nw-t2-nav a.jump-pill {
    font-weight: 600;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.2px;
}
.jump-nav.nw-t2-nav a.jump-pill:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.jump-nav.nw-t2-nav a.jump-pill:hover i {
    color: var(--nuke-gold) !important;
}

/* Scroll target offset — accounts for sticky nwmenu (~52px) + sticky jump-nav (~34px) */
[id="jobs"], [id="fleet"], [id="map"],
[id="outage-status"], [id="discussions"], [id="news"] {
    scroll-margin-top: 95px;
}

/* Back-to-top button */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 899;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--nuke-blue);
    color: #fff !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(52, 102, 153, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--nuke-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.4);
}

/* Outage Widget Styles (homepage fleet tracker) */
.outage-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.outage-stat-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 15px 5px;
    min-width: 90px;
    flex: 1 1 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.outage-stat-box:hover {
    transform: translateY(-5px);
    background-color: var(--bg-white);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #d1d8e0;
}
.outage-stat-box .stat-number {
    display: block;
    font-size: 2em;
    font-weight: 800;
    color: var(--nuke-blue-dark) !important;
    line-height: 1;
    margin-bottom: 8px;
}
.outage-stat-box .stat-label {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}
/* Subtle status-tinted backgrounds matching view.php KPI colors */
.outage-stat-box:nth-child(1) { background: linear-gradient(135deg, #27ae6010, #27ae6018); border-top: 3px solid #27ae60; } /* Grid - green */
.outage-stat-box:nth-child(1) .stat-number { color: #27ae60 !important; }
.outage-stat-box:nth-child(2) { background: linear-gradient(135deg, #27ae6010, #27ae6018); border-top: 3px solid #27ae60; } /* Outages - green */
.outage-stat-box:nth-child(2) .stat-number { color: #27ae60 !important; }
.outage-stat-box:nth-child(3) { background: linear-gradient(135deg, #c0392b10, #c0392b18); border-top: 3px solid #c0392b; } /* Offline - red */
.outage-stat-box:nth-child(3) .stat-number { color: #c0392b !important; }
.outage-stat-box:nth-child(4) { background: linear-gradient(135deg, #e67e2210, #e67e2218); border-top: 3px solid #e67e22; } /* Reduced - orange */
.outage-stat-box:nth-child(4) .stat-number { color: #e67e22 !important; }
.outage-stat-box:nth-child(5) { background: linear-gradient(135deg, #3498db10, #3498db18); border-top: 3px solid #3498db; } /* Coasting - blue */
.outage-stat-box:nth-child(5) .stat-number { color: #3498db !important; }
.outage-stat-box:nth-child(6) { background: linear-gradient(135deg, #f1c40f10, #f1c40f18); border-top: 3px solid #f1c40f; } /* Startup - yellow */
.outage-stat-box:nth-child(6) .stat-number { color: #f1c40f !important; }
.outage-stat-box:nth-child(7) { background: linear-gradient(135deg, #8e44ad10, #8e44ad18); border-top: 3px solid #8e44ad; } /* B2B - purple */
.outage-stat-box:nth-child(7) .stat-number { color: #8e44ad !important; }
.outage-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--nuke-blue);
    color: white !important;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1em;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(52, 102, 153, 0.3);
}
.outage-btn:hover {
    background: #2a5298;
    transform: translateY(-2px);
    text-decoration: none;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
.broadcast-icon {
    animation: pulse 2s infinite;
}

/* Section spacing (replaces <br> spacers between sections) */
.row-jobs,
.row-forum {
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .outage-stat-box {
        flex: 1 1 calc(25% - 15px);
    }
}
@media (max-width: 600px) {
    .jump-nav {
        gap: 5px;
        margin-bottom: 15px;
    }
    .jump-pill {
        padding: 3px 9px;
        font-size: 0.72em;
    }
    .outage-stat-box {
        flex: 1 1 calc(33% - 15px);
    }
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
}
@media (max-width: 480px) {
    /* nwmenu collapses to hamburger on mobile, so jump-nav sticks at top */
    .jump-nav.is-sticky {
        top: 0;
    }
    [id="jobs"], [id="fleet"], [id="map"],
    [id="outage-status"], [id="discussions"], [id="news"] {
        scroll-margin-top: 45px;
    }
}
@media (max-width: 400px) {
    .outage-stat-box {
        flex: 1 1 calc(50% - 15px);
    }
}
