/* LINK-90 Tactical Overlay Styles */

:root {
    --eve-bg: #05080a;
    --eve-border: #1a2a33;
    --eve-cyan: #00f2ff;
    --eve-text: #b0c4de;
    --eve-tab-active: #0c1e26;
    --eve-danger: #ff4444;
    --module-bg: rgba(8, 12, 14, 0.85);
    --inset-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}


/* Tactical Frame Container */
body {
    background-color: #05080a;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: var(--eve-text);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
}

/* Module Labels */
.module-label {
    color: var(--eve-cyan);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    font-weight: bold;
    display: block;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Consolidated Tactical Sidebar */
.side-nav {
    flex: 0 0 280px;            /* Locked width for hardware consistency */
    background: rgba(8, 12, 14, 0.9); /* Deep matte finish */
    border-right: 1px solid var(--eve-border); /* Standardized cyan boundary */
    padding: 20px 15px;         /* Uniform internal spacing */
    display: flex;
    flex-direction: column;     /* Stack modules vertically */
    gap: 20px;                  /* Clear separation between tactical modules */
    overflow-y: auto;           /* Scrollable if fleet grows too large */
    height: fit-content;        /* Adapts to shell height */
}

/* Syncing the look of all number inputs */
input[type="number"] {
    background: #000;
    color: #fff;
    border: 1px solid var(--eve-border);
    padding: 5px;
    width: 100%;
}
*/
#tactical-shell {
    width: 100%;
    max-width: 1600px; /* Locked width for monitor consistency */
    background: #080c0e;
    border: 1px solid rgba(0, 242, 255, 0.1);
    position: relative;
    padding: 30px; /* Internal padding */
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Stylized Corner Brackets */
#tactical-shell::before, #tactical-shell::after,
#shell-corners::before, #shell-corners::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--eve-cyan);
    pointer-events: none;
}

/* Position the 4 corners */
#tactical-shell::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
#tactical-shell::after { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
#shell-corners::before { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
#shell-corners::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

/* The Tactical Grid Background */
.view-pane {
    padding: 20px;
    background-image: 
        linear-gradient(rgba(26, 42, 51, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 42, 51, 0.1) 1px, transparent 1px);
    background-size: 25px 25px; /* Tactical grid spacing */
    min-height: calc(100vh - 200px);
}

/* Tab Navigation Bar */
.tab-bar {
    display: flex;
    background: #0a0f12;
    border-bottom: 1px solid var(--eve-border);
    padding: 5px 10px 0 10px;
    gap: 5px;
}

.intel-tab {
    background: #12191d;
    border: 1px solid var(--eve-border);
    border-bottom: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.intel-tab:hover {
    background: var(--eve-tab-active);
    color: var(--eve-cyan);
}

.intel-tab.active {
    background: var(--eve-tab-active);
    border-bottom: 2px solid var(--eve-cyan);
    color: #fff;
}

/* The Update Notification Pulse */
.tab-update-pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: inset 0 0 5px var(--eve-cyan); }
    50% { box-shadow: inset 0 0 15px var(--eve-cyan); }
    100% { box-shadow: inset 0 0 5px var(--eve-cyan); }
}

/* D-Scan Summary Table */
.ship-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);
}

.ship-summary-table th {
    text-align: left;
    background: #0c1e26;
    color: var(--eve-cyan);
    padding: 10px;
    border: 1px solid var(--eve-border);
    text-transform: uppercase;
    font-size: 0.75rem;
}

.ship-summary-table td {
    padding: 8px 10px;
    border: 1px solid var(--eve-border);
}

/* Ship Visual Icons Container */
.visual-ship-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
}

.ship-card {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px solid var(--eve-border);
    background: #000;
}

.ship-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--eve-cyan);
    color: #000;
    font-weight: bold;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
}

.eve-button-primary {
    background: #0c1e26;
    color: var(--eve-cyan);
    border: 1px solid var(--eve-cyan);
    padding: 8px 15px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.eve-button-primary:hover {
    background: var(--eve-cyan);
    color: #000;
    box-shadow: 0 0 10px var(--eve-cyan);
}

.eve-button-secondary {
    background: transparent;
    color: #666;
    border: 1px solid var(--eve-border);
    padding: 8px 15px;
    cursor: pointer;
}

/* Add to styles/main.css */
.hover-info {
    cursor: help;
    text-decoration: underline dotted var(--eve-border);
}

.hover-info:hover {
    color: #fff;
    text-decoration: underline solid var(--eve-cyan);
}
/* scripts/main.css */
.filter-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(0, 242, 255, 0.1);
    padding: 5px 10px;
    border: 1px solid var(--eve-border);
    border-radius: 3px;
    transition: all 0.2s;
}

.filter-switch:hover {
    border-color: var(--eve-cyan);
    box-shadow: 0 0 5px var(--eve-cyan);
}

.filter-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--eve-cyan);
    letter-spacing: 1px;
}

input[type="checkbox"]#tactical-filter-chk {
    accent-color: var(--eve-cyan);
}

/* High-priority threats (e.g., Flycatcher, Magus) */
tr.threat-critical {
    background: rgba(255, 68, 68, 0.08); /* Faint red tint */
    border-left: 3px solid #ff4444;    /* Strong red indicator */
}

/* Combat threats */
tr.threat-high {
    background: rgba(255, 170, 0, 0.05); /* Faint orange */
    border-left: 3px solid #ffaa00;
}

/* Standard ships */
tr.threat-medium {
    border-left: 3px solid #ffee00;
}

/* styles/main.css */
@keyframes pulse-cyan {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 242, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 255, 0); }
}

.tab-update-pulse {
    animation: pulse-cyan 2s infinite;
    border-bottom: 2px solid var(--eve-cyan) !important;
}

/* main.css additions */
.tactical-layout {
    display: flex;
    height: calc(100vh - 215px); /* Adjust based on your header height */
    max-width: 1920px;
    margin: 0 auto;
    border-top: 1px solid var(--eve-border);
}



.primary-view {
    flex: 1;
    background: #05080a;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Keeps the tables scrolling within the pane */
}

/* Ensure directory buttons stack vertically in the sidebar */
#directory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

#directory-list button {
    width: 100%;
    text-align: left;
}

/* styles/main.css */
.pilot-manifest-entry {
    transition: all 0.2s ease;
}

.pilot-manifest-entry:hover {
    background: rgba(0, 242, 255, 0.1) !important;
    border-color: var(--eve-cyan) !important;
    cursor: default;
}

/* Must match exactly what is in TabManager.renderTab */
.tab-button {
    background: #080c0e;
    color: var(--eve-cyan);
    border: 1px solid var(--eve-border);
    padding: 5px 15px;
    font-size: 0.7rem;
    cursor: pointer;
    /* Add EVE-style glow on active */
}

.tab-button.active {
    background: #002222;
    border-color: #00f2ff;
    box-shadow: inset 0 0 5px #00f2ff;
}

/* Force the tactical HUD to be physically present on screen */
.view-pane {
    display: none; /* Controlled by TabManager.switchView */
    width: 100%;
    min-height: 400px; /* Prevent the container from collapsing to 0px height */
    background: #080c0e !important;
    border: 1px solid #1a2327;
    padding: 10px;
    overflow-y: auto; /* Ensure we can scroll if the fleet is huge */
}

/* Ensure the injected HUD has bright text */
.tactical-hud-inner {
    color: #ffffff !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ship-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.ship-summary-table th {
    color: #00f2ff; /* EVE Cyan */
    text-align: left;
    border-bottom: 2px solid #00f2ff;
    padding: 8px;
}


/* Styling for the in-tab map button */
.tab-map-btn {
    background: none;
    border: none;
    color: var(--eve-cyan);
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 8px;
    padding: 2px;
    transition: opacity 0.2s;
    opacity: 0.6;
}

.tab-map-btn:hover {
    opacity: 1;
    text-shadow: 0 0 5px var(--eve-cyan);
}

/* --- INTERNAL MODULE STYLING --- */

.tactical-module {
    background: rgba(10, 15, 18, 0.6);
    border: 1px solid rgba(0, 242, 255, 0.1);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
    position: relative;
    padding: 15px;
    margin-bottom: 20px;
}

/* Internal Corner Brackets for Modules */
.tactical-module::before, 
.tactical-module::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--eve-cyan);
    pointer-events: none;
    opacity: 0.5;
}

.tactical-module::before { top: 4px; left: 4px; border-right: 0; border-bottom: 0; }
.tactical-module::after { bottom: 4px; right: 4px; border-left: 0; border-top: 0; }

/* --- SPECIFIC MODULE OVERRIDES --- */

#initiator-workspace {
    border-bottom: 1px solid rgba(0, 242, 255, 0.15);
    background: linear-gradient(to bottom, #0a0f12, #080c0e);
    margin-bottom: 30px;
    padding: 20px;
}



/* Inset look for the D-Scan Textarea */
textarea#inputText {
    height: 250px; /* Increased for better situational awareness */
    width:96%;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 12px;
}

#systemInput {
    width: 160px; /* Widened for clear J-ID visibility */
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Aligning the Manual Join field to match the sidebar width */
#joinInput {
    width: calc(100% - 18px); /* Account for padding */
    margin-bottom: 10px;
}

/* Layout Alignment Fixes */
.tactical-input-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.data-entry { flex: 2; }

/* Ensures buttons don't wrap and overlap System ID */
.action-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    flex-wrap: nowrap; /* Prevents the buttons from jumping to a second line */
}

.action-bar input { width: 140px; }

.button-group-right {
    margin-left: auto; /* Pushes Wipe/Clear to the far right */
    display: flex;
    gap: 10px;
}

/* Persistent Dark Backgrounds */
input[type="text"], 
input[type="number"], 
select, 
textarea {
    background-color: #000 !important; /* Forces solid black */
    color: #fff !important;
    border: 1px solid var(--eve-border) !important;
}

/* Fixes the "white background" flip when data is entered */
input:not(:placeholder-shown),
textarea:not(:placeholder-shown) {
    background-color: #000 !important;
    color: var(--eve-cyan) !important; /* Highlights active data in cyan */
}

/* Handles browser auto-fill (often the culprit for yellow/white backgrounds) */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--eve-cyan) !important;
    -webkit-box-shadow: 0 0 0px 1000px #000 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Recon Grid - Clean Alignment */
.recon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.recon-field label {
    display: block;
    font-size: 0.65rem;
    color: var(--eve-cyan);
    margin-bottom: 4px;
}

/* Sidebar Specifics */
.status-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.full-width { width: 100%; margin-top: 10px; }

/* Dark Theme Overrides for Inputs */
input[type="text"], 
input[type="number"], 
select, 
textarea {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid #1a2327 !important;
    color: #fff !important;
    padding: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.85rem;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--eve-cyan) !important;
    outline: none;
    background: rgba(0, 20, 30, 0.6) !important;
}

/* Customizing the Dropdown Arrow for the Pilot Selector */
select#pilotSelector {
    cursor: pointer;
    appearance: none; /* Removes default browser arrow */
    background-image: linear-gradient(45deg, transparent 50%, var(--eve-cyan) 50%),
                      linear-gradient(135deg, var(--eve-cyan) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
                         calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* Sensor Colors (Refined for High Contrast) */
/* Sensor Color Mapping */
.sensor-radar { color: #ff4d4d; }       /* Red */
.sensor-ladar { color: #4dff4d; }       /* Green */
.sensor-magnetometric { color: #4d4dff; } /* Blue */
.sensor-gravimetric { color: #ffff4d; }   /* Yellow */
.sensor-- { color: #666; }              /* Unknown */
/* Standardize the cell alignment */
.sensor-cell {
    text-align: left;
    padding-left: 15px;
}

/* Visual feedback for the interlock */
#analyseButton:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
    border-color: #444;
}

/* Sidebar Room Containers */
.directory-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 242, 255, 0.03); /* Faint cyan wash */
    border: 1px solid rgba(0, 242, 255, 0.1);
    margin-bottom: 8px;
    padding: 6px;
    transition: all 0.2s ease;
}

.directory-row:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: var(--eve-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

/* The Portrait */
.directory-row img {
    width: 28px;
    height: 28px;
    border: 1px solid #1a2327;
    background: #000;
}

/* The Button Logic */
.directory-btn {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    font-family: 'Exo 2', sans-serif;
    cursor: pointer;
    padding: 0;
}

.directory-btn span {
    color: var(--eve-cyan);
    font-weight: bold;
    font-size: 0.85rem;
    display: block;
}

.directory-btn small {
    display: block;
    color: #888;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Module Styling */
.status-box {
    padding: 12px !important;
    background: rgba(0, 242, 255, 0.04) !important;
    border: 1px solid rgba(0, 242, 255, 0.2) !important;
    align-items: flex-start !important; 
    margin-bottom: 10px;
}

.status-portrait {
    width: 42px !important;
    height: 42px !important;
    border: 1px solid var(--eve-border);
    flex-shrink: 0;
}

.status-header {
    line-height: 1.2;
    margin-bottom: 4px;
}

.system-id {
    color: var(--eve-cyan);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.pilot-sub {
    color: #aaa;
    font-size: 0.7rem;
}

/* The Bold Time Indicator */
.status-time {
    color: var(--eve-cyan);
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5); /* Tactical Glow */
    font-family: 'Exo 2', sans-serif;
}

/* Tactical Fleet Summary */
.fleet-summary-module {
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid var(--eve-border);
    padding: 10px;
    margin-bottom: 15px;
}

.total-hostile-header {
    font-size: 1.1rem;
    color: var(--eve-cyan);
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
    text-align: center;
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
    padding-bottom: 5px;
    margin-bottom: 8px;
}

.class-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.class-count {
    background: var(--eve-cyan);
    color: #000;
    font-weight: bold;
    padding: 0 6px;
    border-radius: 2px;
}

/* Tactical Tags */
.tag-trigger {
    color: var(--eve-yellow, #f0ff00); /* Use a high-vis color for warnings */
    font-size: 0.65rem;
    font-weight: bold;
    margin-left: 8px;
    cursor: help;
    border: 1px solid rgba(240, 255, 0, 0.3);
    padding: 0 4px;
    border-radius: 2px;
    vertical-align: middle;
}

.tag-trigger:hover {
    background: rgba(240, 255, 0, 0.1);
    box-shadow: 0 0 5px rgba(240, 255, 0, 0.5);
}
/* Threat Tags */
.tag-badge {
    background: rgba(240, 255, 0, 0.1);
    color: var(--eve-yellow, #f0ff00);
    border: 1px solid rgba(240, 255, 0, 0.4);
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Clean the tactical traces */
.intel-content-area {
    width: 100%;
    overflow: hidden; /* Prunes any bleeding artifacts */
    box-sizing: border-box;
}

.tactical-hud-inner {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}
