﻿/* =========================================
   Embedding Radar Variables
   ========================================= */
:root {
    --radar-bg: #0f172a;
    --radar-panel: #1e293b;
    --radar-border: #334155;
    --radar-text: #f8fafc;
    --radar-muted: #94a3b8;
    --radar-cyan: #06b6d4;
    --radar-blue: #3b82f6;
    --radar-neon-glow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Modal Base */
#radar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.radar-modal-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.radar-modal-container {
    background: var(--radar-bg);
    border: 1px solid var(--radar-border);
    border-radius: 12px;
    width: 900px;
    max-width: 95vw;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Header & Panels */
.radar-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--radar-border);
    color: var(--radar-text);
}

    .radar-modal-header h4 {
        margin: 0;
        font-size: 1.1rem;
    }

.radar-close-btn {
    background: none;
    border: none;
    color: var(--radar-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.radar-modal-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.radar-panel {
    flex: 1;
    background: var(--radar-panel);
    border: 1px solid var(--radar-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.radar-panel-title {
    font-weight: 600;
    color: var(--radar-text);
    text-align: center;
    border-bottom: 1px dashed var(--radar-border);
    padding-bottom: 0.5rem;
}

/* Form Inputs */
.radar-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

    .radar-input-group label {
        color: var(--radar-text);
        font-size: 0.85rem;
        font-weight: 500;
    }

.radar-text-input {
    width: 100%;
    padding: 0.6rem;
    background: #0f172a;
    color: var(--radar-text);
    border: 1px solid var(--radar-border);
    border-radius: 6px;
    outline: none;
    font-family: monospace;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

    .radar-text-input:focus {
        border-color: var(--radar-cyan);
        box-shadow: var(--radar-neon-glow);
    }

/* Technical Metrics Box */
.radar-metrics-box {
    background: #0b1120;
    border: 1px solid var(--radar-border);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radar-metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--radar-muted);
}

.radar-mono {
    font-family: monospace;
    color: var(--radar-cyan);
}

.radar-action-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* =========================================
   Radar Visualization Screen
   ========================================= */
.radar-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    max-width: 300px;
    margin: 0 auto;
    background: #070b14;
    border: 1px solid var(--radar-border);
    border-radius: 8px;
    overflow: hidden;
}

/* Grid & Rings */
.radar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(6, 182, 212, 0.2);
    border-radius: 50%;
}

.radar-ring-1 {
    width: 33%;
    height: 33%;
}

.radar-ring-2 {
    width: 66%;
    height: 66%;
}

.radar-ring-3 {
    width: 95%;
    height: 95%;
    border-style: solid;
    border-color: rgba(6, 182, 212, 0.4);
}

.radar-crosshair-x {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(6, 182, 212, 0.2);
}

.radar-crosshair-y {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(6, 182, 212, 0.2);
}

/* Scanner Sweep Animation */
.radar-scanner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0) 40%, rgba(6, 182, 212, 0.4) 100%);
    transform-origin: 0 0;
    border-right: 2px solid var(--radar-cyan);
    animation: radar-spin 4s linear infinite;
    display: none;
}

@keyframes radar-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* SVG Overlay for Plotting */
.radar-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.radar-hidden {
    opacity: 0;
    transition: opacity 0.3s;
}

.radar-dot {
    filter: drop-shadow(0 0 4px currentColor);
    transition: cx 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), cy 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot-a {
    fill: var(--radar-blue);
    color: var(--radar-blue);
}

.dot-b {
    fill: var(--radar-cyan);
    color: var(--radar-cyan);
}

.radar-label {
    font-size: 8px;
    fill: var(--radar-text);
    font-family: monospace;
    text-anchor: middle;
}

/* Connecting Laser Line */
#radar-laser {
    stroke: rgba(6, 182, 212, 0.8);
    stroke-width: 1.5;
    stroke-dasharray: 4;
    opacity: 0;
    transition: opacity 0.3s, x1 0.5s, y1 0.5s, x2 0.5s, y2 0.5s;
}

/* Results Display */
.radar-results-display {
    display: flex;
    justify-content: space-between;
    background: #000;
    padding: 1rem;
    border-radius: 6px;
}

.radar-result-item {
    text-align: center;
    width: 45%;
}

.radar-result-label {
    font-size: 0.75rem;
    color: var(--radar-muted);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.radar-result-value {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: monospace;
    color: var(--radar-cyan);
}

.radar-value-high {
    color: var(--radar-blue);
}

/* Mobile Adaptability */
.radar-modal-container {
    max-height: 95vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .radar-modal-body {
        flex-direction: column;
        padding: 1rem;
    }

    .radar-modal-container {
        width: 100%;
        border-radius: 8px;
    }

    .radar-screen {
        max-width: 100%;
    }
}
