/* --- css/style.css --- */

/* Variables for easy theming */
:root {
    --bg-color: #0b0c15; /* Deep Space */
    --panel-bg: rgba(20, 22, 31, 0.9);
    --border-color: #444b5d;
    --highlight-cyan: #00f0ff; /* EVE UI Cyan */
    --highlight-red: #ff2a2a; /* Threat Red */
    --text-main: #cdcdcd;
    --text-dim: #797979;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, #1a1c29 0%, #0b0c15 100%);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 40px 20px; /* Added top/bottom padding */
    
    /* REMOVE THIS: height: 100vh; */
    min-height: 100vh; /* USE THIS INSTEAD */
    
    display: flex;
    flex-direction: column; /* Better for scrolling content */
    align-items: center;
    
    /* REMOVE THIS: justify-content: center; */
    /* Only center vertically if you really want, but for dynamic content, top-alignment is safer */
}

/* Ensure the console can grow */
.intel-console {
    width: 100%;
    max-width: 600px;
    /* ... rest of your styles ... */
    margin: 0 auto; /* Centers it horizontally */
    position: relative;
    
    /* OPTIONAL: Add a smooth transition for height changes if you like */
    transition: height 0.3s ease; 
}

/* Decorative Header Bar */
.intel-console::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--highlight-cyan), transparent);
}

h1 {
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 1.4rem;
    color: var(--highlight-cyan);
    margin-top: 0;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

input[type="text"], textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px;
    font-family: 'Courier New', monospace; /* Monospace for data alignment */
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--highlight-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2) inset;
}

textarea {
    resize: vertical;
    height: 150px;
}

button.btn-submit {
    width: 100%;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--highlight-cyan);
    color: var(--highlight-cyan);
    padding: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

button.btn-submit:hover {
    background: var(--highlight-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--highlight-cyan);
}

/* Status Output Area */
#status-display {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid #555;
    font-size: 0.9rem;
    display: none;
}

.status-success { border-color: var(--highlight-cyan) !important; color: #ccffcc; }
.status-error { border-color: var(--highlight-red) !important; color: #ffcccc; }

/* Little decorative corners */
.corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.5s;
}
.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.intel-console:hover .corner { border-color: var(--highlight-cyan); }

/* --- DASHBOARD STYLES --- */

.dashboard-hidden {
    display: none; /* Hidden by default */
    margin-top: 30px;
    border-top: 1px solid #333;
    padding-top: 20px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pilot-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border: 1px solid #333;
}

.pilot-img {
    width: 64px;
    height: 64px;
    border: 1px solid var(--highlight-cyan);
    margin-right: 15px;
}

.pilot-info h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    text-transform: uppercase;
}

.pilot-meta {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.threat-grade {
    margin-left: auto;
    font-size: 2rem;
    font-weight: bold;
    color: var(--highlight-red);
    border: 2px solid var(--highlight-red);
    padding: 5px 15px;
    border-radius: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    text-align: center;
    border-left: 2px solid var(--border-color);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 5px;
}

.text-red { color: var(--highlight-red); }
.text-cyan { color: var(--highlight-cyan); }
.text-gold { color: #ffd700; }

/* --- INTEL GRID --- */
.intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.intel-panel {
    background: rgba(0,0,0,0.2);
    border: 1px solid #333;
    padding: 15px;
}

.intel-panel h3 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--highlight-cyan);
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.list-container {
    font-size: 0.85rem;
    max-height: 150px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.list-item:last-child { border-bottom: none; }

.prob-high { color: var(--highlight-red); font-weight: bold; }
.prob-med { color: orange; }

.list-empty { color: #555; font-style: italic; padding: 10px 0; }

/* Scrollbar styling for that sci-fi feel */
.list-container::-webkit-scrollbar { width: 5px; }
.list-container::-webkit-scrollbar-thumb { background: #333; }

/* --- ASSOCIATE CARDS --- */
.assoc-grid-container {
    display: grid;
    /* Increasing minmax to 350px forces the cards to be wider */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 15px;
    padding: 10px 0;
}
.assoc-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    padding: 10px;
    transition: all 0.3s;
}

.assoc-card:hover {
    border-color: var(--highlight-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.assoc-portrait {
    width: 64px;
    height: 64px;
    border: 1px solid #444;
    margin-right: 15px;
}

.assoc-details {
    flex: 1;
}

.assoc-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    text-decoration: none;
}

.assoc-stat-line {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.ship-icon-mini {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
    border-radius: 50%;
}

.count-badge {
    background: rgba(0, 240, 255, 0.1);
    color: var(--highlight-cyan);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* --- TACTICAL DOSSIER --- */
.dossier-container {
    background: rgba(20, 20, 20, 0.8);
    border-left: 4px solid #ff9f43; /* Orange accent like your ref */
    padding: 20px;
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-wrap: wrap; /* Friendly for smaller screens */
}

/* LEFT: Identity */
.dossier-identity {
    display: flex;
    gap: 15px;
    flex: 1;
    min-width: 280px;
    border-right: 1px solid #333;
    padding-right: 20px;
}

.dossier-portrait {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #555;
}

.dossier-names h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
}

.dossier-meta {
    font-size: 0.8rem;
    background: #333;
    color: #aaa;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 4px 0;
}

.dossier-corp {
    font-size: 0.85rem;
    color: #ddd;
    margin-top: 2px;
}

.threat-badge-container {
    margin-left: auto;
    text-align: center;
}

.threat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ff9f43; /* Threat Orange */
}

.threat-label {
    font-size: 0.6rem;
    color: #777;
    letter-spacing: 1px;
}

/* MIDDLE: Metrics */
.dossier-stats {
    flex: 1;
    min-width: 200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-right: 1px solid #333;
    padding-right: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.stat-row .label { color: #777; font-weight: bold; font-size: 0.75rem; }
.stat-row .value { color: #fff; font-weight: bold; }

/* RIGHT: Top Lists */
.dossier-lists {
    flex: 1.2;
    min-width: 300px;
    display: flex;
    gap: 20px;
}

.top-list-col { flex: 1; }

.list-header {
    font-size: 0.7rem;
    color: #555;
    border-bottom: 1px solid #333;
    margin-bottom: 8px;
    padding-bottom: 2px;
}

.top-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #ccc;
}
.top-item .count { color: #fff; font-weight: bold; }

/* TEMPLATE STUFF --- */
/* --- APPEND THIS TO YOUR EXISTING CSS FILE --- */

/* --- NEW ADDITIONS FOR LISTS --- */

.intel-lists-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    padding: 0 15px; /* Aligns with dossier */
}

.list-column h4 {
    color: #8899a6;
    border-bottom: 1px solid #444;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding-bottom: 5px;
}

.intel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.intel-list li {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 6px 0;
}

.eve-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #111;
    object-fit: contain;
}

.sys-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d75b5b; /* Red marker */
    font-size: 16px;
}

.list-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.list-info .name {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.9rem;
}

.list-info .count {
    color: #d75b5b;
    font-size: 0.75rem;
}

/* --- WIDESCREEN LAYOUT UPDATE --- */

/* 1. Allow the main console to expand when active */
/* The main box is now always wide */
.intel-console {
    width: 100%;
    max-width: 1600px; /* Wide screen format */
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* This class will be added by JS when data loads */
.intel-console.expanded {
    max-width: 1400px; /* Much wider! */
}

/* 2-Column Grid Setup */
/* Update this rule */
.dashboard-columns {
    display: grid;
    /* Changed from 380px to 500px for better table spacing */
    grid-template-columns: 500px 1fr; 
    gap: 30px;
    height: 100%;
    margin-top: 20px;
}
/* --- LEFT COLUMN (Controls & Bio) --- */
.col-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid #333; /* Divider line */
    padding-right: 20px;
}
/* Adjust form inputs for the column width */
textarea {
    height: 100px; /* Slightly shorter to save space */
}

/* --- RIGHT COLUMN (Intel Data) --- */
.col-right {
    display: flex;
    flex-direction: column;
    position: relative;
}
/* Placeholder State */
#right-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #333;
    border: 2px dashed #333;
    border-radius: 10px;
    min-height: 400px;
}
.placeholder-icon { font-size: 60px; margin-bottom: 20px; color: #333; }
.placeholder-text { font-family: monospace; letter-spacing: 2px; }

/* Make the dossier stacked vertically instead of horizontal flex */
.dossier-container {
    flex-direction: column; 
    border-left: none;
    border-top: 4px solid #ff9f43; /* Move accent to top */
    padding: 15px;
}

.dossier-identity {
    border-right: none;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.dossier-stats {
    border-right: none;
    padding-right: 0;
}

.intel-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack panels vertically */
    gap: 20px;
}

/* Adjust the Graph to fit the new space */
#intel-graph {
    height: 500px !important; /* Make it taller since we have horizontal space */
}

/* --- RESPONSIVE FIX (Mobile) --- */
@media (max-width: 1000px) {
    .dashboard-columns {
        grid-template-columns: 1fr; /* Stack them back up on small screens */
    }
    .intel-console.expanded {
        max-width: 95vw;
    }
}

/* --- TABS --- */
.tab-container {
    display: flex;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #555;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}
.tab-btn.active {
    color: var(--highlight-cyan);
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 2px solid var(--highlight-cyan);
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }

/* --- WORKBENCH TABLE (5 Columns) --- */
#ingest-staging {
    margin-top: 20px;
    border: 1px solid #333;
    background: rgba(0,0,0,0.3);
}

/* Give the header and rows the same layout structure */
.workbench-header, .staging-row {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between columns */
}

.workbench-header {
    background: #111;
    padding: 10px;
    font-size: 0.75rem;
    color: #777;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.staging-row {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    transition: background 0.2s;
}
.staging-row:hover { background: rgba(255,255,255,0.05); }

/* Column Widths */


/* Inputs inside table */
/* 1. ID: Fixed, small */
.col-id { 
    width: 25px; 
    color: #555; 
    text-align: center;
    flex-shrink: 0; /* Prevent squashing */
}

/* 2. TAG: Flexible, takes available space */
.col-tag { 
    flex: 2; /* Takes 2x space */
    color: var(--highlight-cyan); 
    font-family: monospace;
    word-break: break-word; /* Wrap long tags nicely */
    line-height: 1.2;
    min-width: 100px; /* Force minimum width */
}

/* 3. SHIP: Flexible, takes less space than tag */
.col-ship { 
    flex: 1; 
    color: #ccc; 
    font-size: 0.8rem;
    white-space: nowrap; /* Keep ship name on one line */
    overflow: hidden;
    text-overflow: ellipsis; /* Add "..." if too long */
    min-width: 80px;
}

/* 4. PILOT INPUT: Fixed comfort width */
.col-pilot { 
    width: 140px; 
    flex-shrink: 0;
}

/* 5. ACTION BUTTON: Fixed width */
.col-action { 
    width: 60px; 
    text-align: right;
    flex-shrink: 0;
}

/* Make the input look cleaner */
.table-input {
    width: 100%;
    background: #0b0c15; /* Darker background */
    border: 1px solid #444;
    color: #fff;
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: 3px;
}
.table-input:focus { 
    border-color: var(--highlight-cyan); 
    outline: none; 
    background: #000;
}

/* Action Button */
.btn-link {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-link:hover { background: var(--highlight-cyan); color: #000; }

.pilot-tags-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.tag-badge {
    background: rgba(0, 240, 255, 0.1);
    color: var(--highlight-cyan);
    padding: 2px 6px;
    font-size: 0.75rem;
    border: 1px solid var(--highlight-cyan);
    border-radius: 3px;
}

/* --- Buttons Styling --- */

/* Share Button on Dossier */
/* The Share Button */
button#copy-url-button {
    background: linear-gradient(135deg, #00f0ff, #0088cc) !important;
    color: #000 !important;
    border: none;
    padding: 8px 15px;
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    transition: all 0.2s ease;
}

button#copy-url-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

#copy-url-button img {
    filter: brightness(0); /* Turn white icon to black for contrast */
}

/* The Clear Button (Text only style) */
.btn-text {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 3px;
    transition: 0.2s;
}

.btn-text:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 0, 0, 0.1);
}
