/* GRIM HORIZON THEME */
:root {
    --bg-color: #050a10;
    --panel-bg: #0b111a;
    --primary-cyan: #00f0ff;
    --dim-cyan: #005f66;
    --alert-color: #ff3333;
    --intersect-color: #ffaa00;
    --text-font: 'Courier New', Courier, monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-cyan);
    font-family: var(--text-font);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.interface-container {
    width: 900px;
    border: 1px solid var(--dim-cyan);
    padding: 2px; /* For the double border effect */
}

/* HEADER */
.header {
    background: var(--panel-bg);
    padding: 10px 20px;
    border-bottom: 1px solid var(--primary-cyan);
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

/* INPUT AREA */
.input-section {
    padding: 20px;
    border-left: 2px solid var(--primary-cyan);
    margin: 20px;
    position: relative;
}

.input-section::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px;
    width: 10px; height: 10px;
    border-top: 2px solid var(--primary-cyan);
    border-left: 2px solid var(--primary-cyan);
}

textarea, input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--dim-cyan);
    color: var(--primary-cyan);
    width: 45%;
    padding: 10px;
    font-family: var(--text-font);
    margin-right: 10px;
}

.controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

button {
    background: transparent;
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 10px 20px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--text-font);
    transition: all 0.2s;
}

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

button.reset {
    border-color: var(--alert-color);
    color: var(--alert-color);
}
button.reset:hover {
    background: var(--alert-color);
    color: #000;
    box-shadow: 0 0 10px var(--alert-color);
}

/* VISUALIZATION CONTAINER */
#results-area {
    margin: 20px;
    min-height: 100px;
    display: none; /* Hidden until scan */
}

.timeline-wrapper {
    position: relative;
    margin-top: 30px;
    padding-top: 20px;
}

.char-label {
    margin-bottom: 5px;
    font-size: 0.9em;
    opacity: 0.8;
}

.timeline-track {
    position: relative;
    height: 30px;
    background: #0f1924;
    border: 1px solid var(--dim-cyan);
    margin-bottom: 20px;
    overflow: hidden;
}

/* The blocks representing corp history */
.history-block {
    position: absolute;
    height: 100%;
    background: var(--dim-cyan);
    border-right: 1px solid #000;
    box-sizing: border-box;
    opacity: 0.6;
}
.history-block:hover {
    opacity: 1;
    background: var(--primary-cyan);
    cursor: crosshair;
}

/* The intersection highlight */
.intersect-marker {
    position: absolute;
    top: 0;
    bottom: 0; /* Spans across both tracks if we wrap them */
    background: repeating-linear-gradient(
      45deg,
      rgba(255, 170, 0, 0.2),
      rgba(255, 170, 0, 0.2) 10px,
      rgba(255, 170, 0, 0.4) 10px,
      rgba(255, 170, 0, 0.4) 20px
    );
    border: 1px dashed var(--intersect-color);
    z-index: 10;
    pointer-events: none;
}

.intersect-info {
    display: flex;
    justify-content: space-between; /* Pushes date to the far right */
    align-items: center;
    text-align: left;
    color: var(--intersect-color);
    margin-top: 10px;
    border: 1px solid var(--intersect-color);
    padding: 8px 15px;
    background: rgba(0,0,0,0.3);
}

/* This wraps the name and tag together on the left */
.intersect-info span:first-child {
    display: flex;
    align-items: center;
}

/* ADD THIS TO THE BOTTOM OF style.css */

/* Custom Grim Horizon Popup */
#grim-tooltip {
    position: fixed;
    display: none;
    background: rgba(11, 17, 26, 0.95);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 10px 15px;
    font-size: 0.9em;
    pointer-events: none; /* Mouse ignores it so it doesn't flicker */
    z-index: 9999;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    max-width: 300px;
}

#grim-tooltip .tt-header {
    color: #fff;
    border-bottom: 1px solid var(--dim-cyan);
    padding-bottom: 5px;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

#grim-tooltip .tt-detail {
    font-size: 0.8em;
    color: var(--primary-cyan);
    opacity: 0.8;
}

/* Add a highlight effect when hovering history blocks */
.history-block:hover {
    background-color: #fff !important; /* Flash white on hover */
    opacity: 1;
    z-index: 50;
    box-shadow: 0 0 10px #fff;
}

.alliance-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    /* Purple/Magenta hash for Alliance matches */
    background: repeating-linear-gradient(
      -45deg,
      rgba(255, 0, 255, 0.15),
      rgba(255, 0, 255, 0.15) 10px,
      rgba(255, 0, 255, 0.25) 10px,
      rgba(255, 0, 255, 0.25) 20px
    );
    border: 1px dashed #ff00ff;
    z-index: 5; /* Below Corp matches (z-index 10) so Corp match takes precedence */
    pointer-events: none;
}

/* Updated Info Box */
.intersect-info .type-tag {
    font-weight: bold;
    background: var(--intersect-color);
    color: #000;
    padding: 2px 5px;
    margin-right: 10px;
    font-size: 0.8em;
}

.intersect-info.is-alliance {
    border-color: #ff00ff;
    color: #ff00ff;
}
.intersect-info.is-alliance .type-tag {
    background: #ff00ff;
}

/* Tooltip Sub-header for Alliance Name */
.tt-sub {
    color: #aaa;
    font-size: 0.85em;
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: 1px dotted #333;
    font-style: italic;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: var(--panel-bg);
    border: 2px solid var(--primary-cyan);
    padding: 2px;
    width: 600px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.modal-content textarea {
    width: 95%;
    height: 300px;
    background: #000;
    color: #0f0; /* Matrix green for text */
    border: none;
    resize: none;
    font-family: monospace;
    padding: 15px;
    margin: 10px;
}
