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

body {
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
}

.lcars-frame {
    border: 20px solid #666666;
    min-height: 100vh;
    background-color: #ffffff;
    position: relative;
    transition: border-color 0.3s ease;
}

.lcars-frame.yellow {
    border-color: #ffcc00;
}

.lcars-frame.red {
    border-color: #ff0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { border-color: #ff0000; }
    50% { border-color: #cc0000; }
}

.lcars-header {
    background-color: #333333;
    color: #ffffff;
    padding: 10px 30px;
    border-bottom: 5px solid #666666;
    overflow: hidden;
}

.lcars-logo-wrap {
    float: left;
    padding-right: 20px;
}

.lcars-logo {
    height: 70px !important;
    width: auto !important;
    max-height: 70px;
    max-width: 100%;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.lcars-header-text {
    display: block;
}

.lcars-title {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 3px;
}

.lcars-subtitle {
    font-size: 1em;
    color: #cccccc;
    margin-top: 5px;
}

.main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-footer {
    margin: 0 20px 20px;
    text-align: center;
    font-size: 0.85em;
    color: #555555;
}

.plot-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: #000000;
    border: 3px solid #666666;
    border-radius: 50%;
    overflow: hidden;
}

#polarPlot {
    width: 100%;
    height: auto;
    display: block;
}

.plot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.direction-label {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.direction-label.north {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.direction-label.east {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.direction-label.south {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.direction-label.west {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.options-panel {
    background-color: #f0f0f0;
    border: 3px solid #666666;
    padding: 20px;
    border-radius: 10px;
}

.panel-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #cccccc;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    color: #333333;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #666666;
    padding-bottom: 5px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1em;
}

.control-group input[type="number"],
.control-group input[type="radio"],
.control-group input[type="checkbox"] {
    padding: 5px;
    border: 2px solid #666666;
    border-radius: 3px;
}

.control-group input[type="radio"] {
    width: auto;
}

.control-group button {
    padding: 10px 20px;
    background-color: #333333;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.control-group button:hover {
    background-color: #555555;
}

.toggle-advanced-btn {
    width: 100%;
    margin: 10px 0 20px;
    padding: 10px 20px;
    background-color: #333333;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.toggle-advanced-btn:hover {
    background-color: #555555;
}

.manual-location-disabled {
    opacity: 0.55;
    filter: grayscale(0.2);
}

#mapSquare {
    width: 100%;
    aspect-ratio: 1 / 1;   /* forces square */
    max-width: 100%;
    position: relative;
}

#mapContainer {
    position: absolute;
    inset: 0;
}

.map-overlay-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #666666;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
}

.map-lock-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000000;
}

.map-lock-toggle input[type="checkbox"] {
    margin: 0;
}

.aircraft-table-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #ffffff;
    border: 2px solid #666666;
    border-radius: 5px;
}

.aircraft-table-container h3 {
    color: #333333;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #666666;
    padding-bottom: 5px;
}

.aircraft-table {
    width: 100%;
    border-collapse: collapse;
    font-family: monospace;
    font-size: 0.9em;
}

.aircraft-table thead {
    background-color: #333333;
    color: #ffffff;
}

.aircraft-table th,
.aircraft-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #666666;
}

.aircraft-table th {
    font-weight: bold;
    text-align: center;
}

.aircraft-table tbody tr:nth-child(even) {
    background-color: #f0f0f0;
}

.aircraft-table tbody tr:hover {
    background-color: #e0e0e0;
}

.aircraft-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid #000000;
}

.aircraft-marker {
    background: transparent;
    border: none;
}

.location-display {
    margin-top: 15px;
    padding: 10px;
    background-color: #ffffff;
    border: 2px solid #666666;
    border-radius: 5px;
}

.location-display div {
    margin: 5px 0;
    font-family: monospace;
}

.visuals {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.popup.hidden {
    display: none;
}

.hidden {
    display: none;
}

.popup-content {
    background: #111;
    color: white;
    padding: 20px 24px;
    border-radius: 10px;
    max-width: 320px;
    text-align: center;
}

.popup-content button {
    margin: 8px;
    padding: 8px 14px;
    font-size: 14px;
}


/* Landscape (width / height > 1) */
@media (orientation: landscape) {
    .visuals {
        flex-direction: row;
        align-items: flex-start;
    }

    .plot-container,
    #mapSquare {
        flex: 1 1 0;        /* ← CHANGE */
        max-width: none;    /* ← CHANGE */
    }
}


#statusDisplay {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#statusDisplay div {
    padding: 8px;
    background-color: #ffffff;
    border: 2px solid #666666;
    border-radius: 5px;
    font-family: monospace;
}

#alertLevel {
    font-weight: bold;
}

#alertLevel.normal {
    color: #00aa00;
}

#alertLevel.warning {
    color: #ffcc00;
}

#alertLevel.danger {
    color: #ff0000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lcars-frame {
        border-width: 10px;
    }
    
    .lcars-title {
        font-size: 1.8em;
    }
    
    .plot-container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .direction-label {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .lcars-title {
        font-size: 1.5em;
    }
    
    .lcars-subtitle {
        font-size: 0.9em;
    }
    
    .direction-label {
        font-size: 16px;
    }
}


