/* --- Global Styles & Variables --- */
:root {
    --bg-dark: #080b11;
    --bg-card: rgba(18, 24, 38, 0.7);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --text-main: #f0f4f8;
    --text-muted: #94a3b8;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    /* Subtle starry background overlay */
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(79, 172, 254, 0.15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 242, 254, 0.05), transparent 40%);
    background-attachment: fixed;
}

body.modal-open,
body.lightbox-open {
    overflow: hidden;
}

.dev-notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(3, 8, 15, 0.8);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.dev-notice-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.dev-notice-modal {
    position: relative;
    width: min(100%, 480px);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 242, 254, 0.25);
    background: linear-gradient(145deg, rgba(18, 24, 38, 0.95), rgba(8, 11, 17, 0.95));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.dev-notice-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.dev-notice-close:hover {
    color: var(--accent-cyan);
}

.dev-notice-eyebrow {
    margin-bottom: 0.5rem;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.dev-notice-modal h2 {
    margin-bottom: 0.75rem;
    font-size: 1.6rem;
}

.dev-notice-modal p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dev-notice-modal .btn {
    margin-top: 0.5rem;
}

/* --- Navigation Header --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    border-bottom: 1px solid var(--bg-card-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Updated logo image styling */
.logo-icon {
    width: 28px;        /* Adjust size to match navbar height */
    height: 28px;       /* Keep aspect ratio square */
    object-fit: contain; /* Prevents stretching */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

/* --- Buttons --- */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #000;
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
}

.btn-outline:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* --- Hero Section --- */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 1rem 4rem 1rem;
}

.hero-content {
    max-width: 750px;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Search Bar --- */
.search-box {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(8px);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* --- Metrics Section --- */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 2rem auto 5rem auto;
    padding: 0 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.metric-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Category Cards --- */
.vehicle-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto 6rem auto;
    padding: 0 1.5rem;
}

.categories {
    max-width: 1100px;
    margin: 0 auto 0 auto;
    padding: 0;
}

.categories .card {
    text-align: center;
    align-items: center;
}

.categories .card .card-tag,
.categories .card h3,
.categories .card p {
    width: 100%;
    text-align: center;
}

.categories .card h3 {
    font-size: 1.15rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.categories h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 260px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 242, 254, 0.4);
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
    flex: 1 1 auto;
}

.card-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--bg-card-border);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--text-main);
    text-decoration: underline;
}

.license-note {
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

/* --- Article / Detail Page Styles --- */
.page-shell {
    max-width: 980px;
    margin: 3.5rem auto 5rem;
    padding: 0 1.5rem;
}

.article-card {
    padding: 2.2rem 2.2rem 2.5rem;
}

.article-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-copy {
    flex: 1 1 0;
    min-width: 240px;
}

.article-title {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.article-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 0;
}

.article-media {
    flex: 0 0 260px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    padding: 0.75rem;
    overflow: hidden;
}

.article-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.article-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.fact-card {
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.fact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.fact-value {
    margin-top: 0.35rem;
    font-weight: 600;
}

.article-section-list {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.article-section-card {
    padding: 1.7rem 2rem;
}

.article-section-title {
    font-size: 1.35rem;
    margin-bottom: 0.8rem;
}

.article-section-text {
    color: var(--text-muted);
}

.article-inline-media {
    margin: 0.75rem 0 1rem 0;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    justify-self: start;
    align-self: start;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 0.6rem;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
}

.article-inline-media img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

.categories .article-inline-media {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.75rem 0 0;
    border: none;
    background: transparent;
    padding: 0;
}

.categories .article-inline-media img {
    width: min(220px, 100%);
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.article-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
    gap: 1rem;
    margin: 1rem 0;
}

.article-image-grid .article-inline-media {
    margin: 0;
}

img.zoomable-image {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(3, 8, 15, 0.9);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-image {
    max-width: min(100%, 1100px);
    max-height: min(100%, 85vh);
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

.lightbox-caption {
    position: absolute;
    bottom: 1.25rem;
    max-width: min(100%, 900px);
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(8, 11, 17, 0.9);
    color: var(--text-main);
    font-size: 0.95rem;
    text-align: center;
}

.article-section-card {
    overflow: hidden;
}

.article-section-card p {
    overflow: hidden;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Hide standard links on mobile view */
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .search-box {
        flex-direction: column;
    }
}

/* --- Loading Indicator Styles --- */
.loading-state {
    grid-column: 1 / -1; /* Spans full width of the card grid */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-top: 3px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Masseys Sheet Table Styling --- */
.sheet-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #121316;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.sheet-table th {
    background-color: #08080a;
    color: #ffffff;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.sheet-table td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    vertical-align: middle;
}

.sheet-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Vehicle Tag Colors (Purple for Booster, Blue for Ship) */
.vehicle-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s;
}

.vehicle-tag:hover {
    opacity: 0.85;
}

.vehicle-tag.booster {
    background-color: #3b2871; /* Sheet Purple */
    color: #e2d5ff;
}

.vehicle-tag.ship {
    background-color: #1b4372; /* Sheet Dark Blue */
    color: #d0e4ff;
}

/* Test Type Pill */
.pill-blue {
    background-color: #0265dc; /* Sheet Bright Blue */
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: var(--font-mono, monospace);
}

/* Outcome Color Coding */
.outcome-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

.outcome-success {
    background-color: #236c28; /* Sheet Green */
    color: #79f282;
}

.outcome-failure {
    background-color: #7c1f1f; /* Red */
    color: #ff9d9d;
}

.outcome-warning {
    background-color: #7a5f18; /* Yellow/Amber */
    color: #ffe68d;
}

.outcome-unknown {
    background-color: #383838;
    color: #b0b0b0;
}

/* Utilities */
.font-mono {
    font-family: var(--font-mono, monospace);
}

.text-center {
    text-align: center;
}

.table-notes {
    color: #a0a0a0;
    font-size: 0.85rem;
}