/* Retro Terminal Theme - Hackerman Edition */
:root {
    --primary-red: #ff0000;
    --secondary-red: #cc0000;
    --dark-red: #660000;
    --terminal-bg: #0d1117;
    --terminal-border: #21262d;
    --console-bg: #010409;
    --text-primary: #ff0000;
    --text-secondary: #ff4444;
    --text-dim: #6b7280;
    --text-yellow: #ffaa44;
    --error-red: #ff4444;
    --warning-orange: #ffaa44;
    --radar-glow: #ff0000;
    --radar-teal: #00ffff;
    --radar-orange: #ffaa44;
}

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

body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: var(--terminal-bg);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
}

/* Terminal Container */
.terminal-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--terminal-bg);
    border: 2px solid var(--terminal-border);
}

/* Terminal Header */
.terminal-header {
    background: var(--console-bg);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--terminal-border);
    font-size: 12px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.control-btn.close { background: var(--error-red); }
.control-btn.minimize { background: var(--warning-orange); }
.control-btn.maximize { background: var(--primary-red); }

.terminal-title {
    font-weight: bold;
    color: var(--text-primary);
}

.system-status {
    display: flex;
    gap: 16px;
    font-size: 11px;
}

.status-indicator {
    color: var(--primary-red);
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    position: relative;
}

/* Radar Container (Full Screen) */
.radar-container {
    flex: 1;
    position: relative;
    background: var(--console-bg);
    overflow: hidden;
}

.radar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Radar Circles - Removed static rings */
.radar-circles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Animated Radar Sweep Rings */
.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid var(--dark-red);
    box-shadow: 0 0 10px var(--dark-red);
    animation: radarSweep 6s linear infinite;
    opacity: 0;
}

.radar-sweep:nth-child(1) { animation-delay: 0s; }
.radar-sweep:nth-child(2) { animation-delay: 1s; }
.radar-sweep:nth-child(3) { animation-delay: 2s; }
.radar-sweep:nth-child(4) { animation-delay: 3s; }
.radar-sweep:nth-child(5) { animation-delay: 4s; }
.radar-sweep:nth-child(6) { animation-delay: 5s; }

@keyframes radarSweep {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 2px;
        box-shadow: 0 0 20px var(--dark-red);
    }
    50% {
        opacity: 0.6;
        border-width: 1px;
        box-shadow: 0 0 10px var(--dark-red);
    }
    100% {
        width: 1000px;
        height: 1000px;
        opacity: 0;
        border-width: 1px;
        box-shadow: 0 0 5px var(--dark-red);
    }
}

/* Compass Directions */
.compass-directions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.direction {
    position: absolute;
    color: var(--primary-red);
    font-weight: bold;
    font-size: 16px;
}

.direction.north { top: -520px; left: -10px; }
.direction.east { top: -10px; left: 520px; }
.direction.south { top: 520px; left: -10px; }
.direction.west { top: -10px; left: -520px; }

/* Center Point - Fixed positioning */
.center-point {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    width: 0;
    height: 0;
}

.center-glow {
    width: 5px;
    height:5px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: -2.5px;
    left: -2.5px;
}

.center-dot {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 15px white;
    position: relative;
    z-index: 5;
}

.center-label {
    margin-top: 8px;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
}

@keyframes centerPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* Network Hops - Use same coordinate system as center dot */
.hops-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    pointer-events: none;
}

.hop-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: hopAppear 0.5s ease-out;
}

.hop-dot {
    width: 12px;
    height: 12px;
    background: var(--radar-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--radar-orange);
    position: relative;
}

/* Real DNS results - filled circles */
.hop-dot.real {
    background: var(--radar-orange);
    box-shadow: 0 0 10px var(--radar-orange);
}

/* Simulated hops - stroke circles */
.hop-dot.simulated {
    background: transparent;
    border: 1px solid var(--primary-red);
    box-shadow: 0 0 5px var(--primary-red);
}

.hop-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--radar-orange);
    font-weight: bold;
    font-size: 10px;
}

.hop-name {
    margin-top: 15px;
    color: var(--radar-orange);
    font-size: 10px;
    text-align: center;
    max-width: 80px;
    word-wrap: break-word;
}

/* Simulated hop text - red */
.hop-marker .simulated .hop-number,
.hop-marker .simulated .hop-name {
    color: var(--primary-red);
}

/* Real hop text - yellow/orange */
.hop-marker .real .hop-number,
.hop-marker .real .hop-name {
    color: var(--radar-orange);
}

@keyframes hopAppear {
    from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Connection Lines - Use same coordinate system */
.connection-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1000px;
    height: 1000px;
    pointer-events: none;
}

.connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, var(--radar-teal), transparent);
    box-shadow: 0 0 5px var(--radar-teal);
    transform-origin: left center;
    animation: lineDraw 1s ease-out;
}

@keyframes lineDraw {
    from { width: 0; }
    to { width: 100%; }
}

/* Console Panel (Compact) */
.console-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 450px;
    background: rgba(1, 4, 9, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.15);
    backdrop-filter: blur(1px);
    z-index: 10;
}

.console-header {
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255, 0, 0, 0.1);
    font-size: 8px;
}

.console-title {
    color: var(--primary-red);
    font-weight: bold;
}

.console-output {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) transparent;
    padding: 6px 10px;
    font-size: 8px;
    line-height: 1.2;
}

.console-output::-webkit-scrollbar {
    width: 3px;
}

.console-output::-webkit-scrollbar-track {
    background: transparent;
}

.console-output::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 2px;
    opacity: 0.5;
}

/* Log Lines with Visual Hierarchy */
.log-line {
    margin-bottom: 1px;
    font-size: 7px;
}

.log-info { 
    color: var(--secondary-red); 
    font-weight: normal;
}

.log-success { 
    color: var(--secondary-red); 
    font-weight: normal;
}

.log-warning { 
    color: var(--text-yellow); 
    font-weight: bold;
}

.log-error { 
    color: var(--error-red); 
    font-weight: bold;
}

.log-dim { 
    color: var(--secondary-red); 
    font-weight: normal;
}

.status-ok {
    color: var(--text-yellow);
    font-weight: bold;
}

/* Command Input (Bottom) - Prominent */
.command-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    background: rgba(255, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 0 0 4px 4px;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.input-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
}

.prompt {
    color: var(--text-secondary);
    font-weight: bold;
}

.command {
    color: var(--text-yellow);
    font-weight: bold;
}

#target-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    min-width: 80px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
}

#target-input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.trace-button {
    background: var(--primary-red);
    color: var(--console-bg);
    border: none;
    padding: 6px 12px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    font-size: 11px;
    box-shadow: 0 0 5px var(--primary-red);
    height: 28px;
    flex-shrink: 0;
    white-space: nowrap;
}

.trace-button:hover {
    background: var(--secondary-red);
    box-shadow: 0 0 8px var(--primary-red);
}

.trace-button:disabled {
    background: var(--text-dim);
    cursor: not-allowed;
    box-shadow: none;
}

/* Status Bar */
.status-bar {
    background: var(--console-bg);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--terminal-border);
    font-size: 11px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-right {
    display: flex;
    gap: 16px;
}

.progress-indicator {
    color: var(--primary-red);
    animation: blink 1s infinite;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.log-data {
    margin-left: 20px;
    color: var(--text-dim);
    font-size: 8px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .console-panel {
        width: 400px;
    }
}

@media (max-width: 768px) {
    .console-panel {
        width: 350px;
        bottom: 10px;
        left: 10px;
    }
    
    .radar-circle {
        transform: scale(0.8);
    }
    
    .direction {
        font-size: 14px;
    }
    
    .command-input {
        padding: 10px 8px;
        gap: 8px;
    }
    
    .input-container {
        font-size: 11px;
        gap: 5px;
    }
    
    #target-input {
        font-size: 11px;
        min-width: 100px;
    }
    
    .trace-button {
        font-size: 10px;
        padding: 5px 10px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .console-panel {
        width: 320px;
        max-height: 150px;
        bottom: 5px;
        left: 5px;
    }
    
    .radar-circle {
        transform: scale(0.6);
    }
    
    .direction {
        font-size: 12px;
    }
    
    .console-output {
        max-height: 80px;
        font-size: 7px;
    }
    
    .log-line {
        font-size: 6px;
    }
    
    .command-input {
        padding: 6px 6px;
        gap: 6px;
    }
    
    .input-container {
        font-size: 9px;
        gap: 3px;
    }
    
    #target-input {
        font-size: 9px;
        min-width: 60px;
    }
    
    .trace-button {
        font-size: 8px;
        padding: 3px 6px;
        height: 22px;
    }
}

/* Summary Display (Bottom Right) */
.summary-display {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.summary-item {
    color: var(--primary-yellow);
    font-weight: bold;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.summary-item.distance {
    font-size: 24px;
    color: var(--primary-yellow);
}

.summary-item.route {
    font-size: 16px;
    color: var(--text-secondary);
}

.summary-item.speed {
    font-size: 12px;
    color: var(--text-dim);
}

/* Responsive adjustments for summary display */
@media (max-width: 768px) {
    .summary-display {
        bottom: 10px;
        right: 10px;
    }
    
    .summary-item.distance {
        font-size: 20px;
    }
    
    .summary-item.route {
        font-size: 14px;
    }
    
    .summary-item.speed {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .summary-display {
        bottom: 5px;
        right: 5px;
    }
    
    .summary-item.distance {
        font-size: 18px;
    }
    
    .summary-item.route {
        font-size: 12px;
    }
    
    .summary-item.speed {
        font-size: 9px;
    }
}