:root {
    --bg-color: #050505;
    --text-color: #00ff41; /* Radar Green */
    --accent-color: #00cc33;
    --dim-text: #005511;
    --highlight: #e0f0e0;
    --needle-color: #ff3333;
    --font-ui: 'Courier New', Courier, monospace; /* Radar/Tech feel */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-ui);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- UTILS --- */
.view {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 10px;
    background: radial-gradient(circle at center, #0a1a0a 0%, #000000 100%);
}

.view.active {
    display: flex;
}

button {
    font-family: inherit;
    border: 1px solid var(--text-color);
    background: #001100;
    color: var(--text-color);
    padding: 10px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
}

button:active {
    background: var(--text-color);
    color: #000;
}

/* --- PASS TABLE VIEW --- */
.app-header h1 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--text-color);
}

.controls-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid var(--dim-text);
    border-radius: 5px;
}

.full-width {
    grid-column: 1 / -1;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--dim-text);
    margin-bottom: 5px;
}

.control-group input {
    width: 100%;
    background: #000;
    border: 1px solid var(--dim-text);
    color: var(--text-color);
    padding: 8px;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
}

.toggle-group {
    display: flex;
    gap: 5px;
}

.toggle-btn {
    flex: 1;
    font-size: 0.8rem;
    opacity: 0.5;
}

.toggle-btn.active {
    opacity: 1;
    background: var(--dim-text);
    box-shadow: 0 0 5px var(--accent-color);
}

.action-btn {
    grid-column: 1 / -1;
    font-size: 1.1rem;
    padding: 12px;
    background: var(--dim-text);
    border: 1px solid var(--text-color);
}

.table-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--dim-text);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    position: sticky;
    top: 0;
    background: #002200;
    padding: 10px 5px;
    border-bottom: 1px solid var(--text-color);
    font-size: 0.8rem;
}

td {
    padding: 10px 5px;
    border-bottom: 1px solid #002200;
    text-align: center;
}

tr:active {
    background: #003300;
}

/* --- TRACKING VIEW --- */
.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    background: rgba(0,0,0,0.8);
    border: none;
    color: var(--text-color);
    font-size: 1rem;
}

.tracking-info {
    text-align: center;
    margin-top: 40px; /* Space for back btn */
    margin-bottom: 20px;
}

.tracking-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.telemetry {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.telem-item {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.7rem;
    color: var(--dim-text);
}

.value {
    font-size: 1.1rem;
    font-weight: bold;
}

.radar-layout {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.compass-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compass-ring {
    width: 80vw;
    height: 80vw;
    max-width: 400px;
    max-height: 400px;
    border: 2px solid var(--dim-text);
    border-radius: 50%;
    position: relative;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 49px, #001100 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, #001100 50px);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

.compass-mark {
    position: absolute;
    font-weight: bold;
    font-size: 1.2rem;
}

.compass-mark.N { top: 5px; left: 50%; transform: translateX(-50%); color: var(--needle-color); }
.compass-mark.E { right: 10px; top: 50%; transform: translateY(-50%); }
.compass-mark.S { bottom: 5px; left: 50%; transform: translateX(-50%); }
.compass-mark.W { left: 10px; top: 50%; transform: translateY(-50%); }

.azimuth-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 45%; /* Radius length approx */
    background: var(--needle-color);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg); /* Initial Rotation */
    transition: transform 1s linear;
}

.azimuth-needle::after {
    /* Arrowhead */
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 10px solid var(--needle-color);
}

.sat-marker {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -150%); /* Sit just above the needle tip */
    font-size: 1.5rem;
}

.elevation-container {
    width: 40px;
    margin-left: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--dim-text);
}

.elevation-bar-bg {
    width: 100%;
    height: 80%;
    background: #001100;
    position: relative;
    border: 1px solid var(--dim-text);
}

.elevation-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%; /* Dynamic */
    background: linear-gradient(to top, #003300, var(--text-color));
    transition: height 1s linear;
}

.el-mark {
    position: absolute;
    right: 45px; /* Left of the bar */
    font-size: 0.7rem;
    color: var(--dim-text);
}

.el-mark.top { top: 10%; }
.el-mark.mid { top: 50%; }
.el-mark.bot { bottom: 10%; }
