/* CSS Custom Properties - Bright Blues & Greens Industrial Theme */
:root {
    --color-bg-primary: #0a0f14;      /* Dark teal-ish black */
    --color-bg-secondary: #141b22;    /* Slightly lighter cyan-gray */
    --color-panel: #1c2430;           /* Blue-gray panel */
    --color-border: #2d3a45;          /* Medium blue-gray border */
    --color-border-light: #3d4a55;    /* Lighter blue-gray */
    --color-accent-alt: #2a5a4a;      /* Muted teal green */
    --color-accent-primary: #4a9a7a;  /* Brightened mint green */
    --color-accent-highlight: #6acaa0;/* Bright aqua/cyan highlight */
    --color-text-primary: #c8e6c9;    /* Light mint/blue-tinted white */
    --color-text-secondary: #a8c9b8;  /* Medium mint */
    --color-text-muted: #688888;      /* Muted blue-gray */

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Share Tech Mono', monospace;

    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(106, 202, 160, 0.25);
    --glow-highlight: 0 0 10px rgba(106, 202, 160, 0.3);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Link Colors */
a {
    color: var(--color-accent-highlight);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-primary);
    text-decoration: underline;
}

/* VFX Overlays */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(106, 202, 160, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(106, 202, 160, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* Corner brackets */
body::before, body::after {
    content: '';
    position: fixed;
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-accent-primary);
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
}

body::before {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

body::after {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--color-accent-alt) 0%,
        var(--color-accent-highlight) 50%,
        var(--color-accent-alt) 100%);
    opacity: 0.8;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo-icon {
    font-size: 2.5em;
    color: var(--color-accent-highlight);
    text-shadow: 0 0 15px rgba(106, 202, 160, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-accent-highlight);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-subtitle {
    font-size: 0.85em;
    color: var(--color-accent-primary);
    letter-spacing: 1px;
    opacity: 0.8;
}

.header-meta {
    margin-top: 10px;
}

.version-badge {
    display: inline-block;
    background: var(--color-accent-alt);
    color: var(--color-accent-highlight);
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8em;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Filter Bar */
.filter-bar {
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 73px;
    z-index: 90;
    background: var(--color-bg-primary);
}

.filter-bar .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group label {
    font-family: var(--font-heading);
    font-size: 0.9em;
    color: var(--color-accent-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    min-width: 60px;
}

.filter-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    padding: 8px 16px;
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 0.85em;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    border-color: var(--color-accent-highlight);
    color: var(--color-accent-highlight);
}

.filter-btn.active {
    background: var(--color-panel);
    border-color: var(--color-accent-highlight);
    color: var(--color-accent-highlight);
    box-shadow: 0 0 8px rgba(106, 202, 160, 0.3);
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent-primary);
    font-size: 1.2em;
    z-index: 10;
}

.search-box input {
    width: 100%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    color: var(--color-accent-primary);
    padding: 12px 12px 12px 44px;
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 1em;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-accent-highlight);
    box-shadow: var(--glow-highlight);
}

.search-box input::placeholder {
    color: var(--color-text-muted);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--color-panel);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.stat-label {
    font-size: 0.75em;
    color: var(--color-accent-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2em;
    font-weight: 700;
    color: var(--color-accent-highlight);
}

/* Blueprint Grid */
.blueprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Blueprint Card */
.blueprint-card {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-panel) 100%);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 24px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.blueprint-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--color-accent-alt) 0%,
        var(--color-accent-highlight) 50%,
        var(--color-accent-alt) 100%);
    opacity: 0.8;
    transition: opacity var(--transition-normal);
}

.blueprint-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-border-light);
}

.blueprint-card:hover::before {
    opacity: 1;
}

.blueprint-card:focus {
    outline: 2px solid var(--color-accent-highlight);
    outline-offset: 2px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.card-header .card-title {
    margin: 0;
    flex: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.15em;
    font-weight: 700;
    color: var(--color-accent-highlight);
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.type-badge, .faction-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-weight: 600;
}

.type-badge {
    background: var(--color-accent-primary);
    color: var(--color-bg-primary);
    border: none;
    font-size: 0.65em;
    padding: 3px 10px;
    flex-shrink: 0;
    font-weight: 700;
}

.card-subtype {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.card-contracts {
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
}

.contract-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8em;
}

.contract-faction {
    background: var(--color-panel);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.contract-name {
    color: var(--color-text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-rate {
    background: var(--color-accent-alt);
    color: var(--color-accent-highlight);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.75em;
    font-weight: 700;
}

.contract-more {
    text-align: center;
    color: var(--color-accent-highlight);
    font-size: 0.8em;
    padding: 4px 0;
    font-style: italic;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
}

.no-results h3 {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--color-accent-highlight);
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

.modal-content {
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-accent-highlight);
    border-radius: 6px;
    max-width: 650px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 60px rgba(106, 202, 160, 0.15);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--color-accent-primary);
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: rgba(106, 202, 160, 0.1);
    color: var(--color-accent-highlight);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-panel);
    border-radius: 6px 6px 0 0;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.6em;
    color: var(--color-accent-highlight);
    margin: 0;
    padding-right: 40px;
}

.modal-header .blueprint-type {
    display: inline-block;
    background: var(--color-accent-alt);
    color: var(--color-accent-primary);
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-body {
    padding: 24px;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contract-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 16px;
}

.contract-card h4 {
    font-family: var(--font-heading);
    font-size: 1em;
    color: var(--color-accent-primary);
    margin-bottom: 8px;
}

.contract-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85em;
    color: var(--color-text-secondary);
}

.contract-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary);
}

.contract-meta strong {
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 0.5px;
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--color-border);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
}

.main-footer p {
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin: 5px 0;
}

.main-footer .disclaimer {
    font-size: 0.75em;
    opacity: 0.7;
    max-width: 800px;
    margin: 10px auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .blueprint-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-header {
        position: static;
        padding: 12px 0;
    }

    .filter-bar {
        position: static;
        top: 0;
        padding: 16px 0;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group label {
        margin-bottom: 8px;
    }

    .blueprint-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }

    .stats-bar {
        gap: 15px;
    }

    .stat-item {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        font-size: 2em;
    }

    .logo h1 {
        font-size: 1.1em;
    }

    .logo-subtitle {
        font-size: 0.75em;
    }

    .blueprint-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 1.3em;
    }

    .filter-group {
        gap: 10px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-alt);
}
