/* General styles */
:root {
    --primary-dark: #0a0e14;
    --secondary-dark: #141a24;
    --accent-blue: #2a4368;
    --highlight-blue: #3a6fc4;
    --text-color: #d8e1e9;
    --alert-red: #c93840;
    --success-green: #2a9d3a;
    --warning-yellow: #e7a212;
    --grid-lines: rgba(66, 120, 204, 0.3);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto Mono', monospace;
    background-color: var(--primary-dark);
    color: var(--text-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header with operational status */
#header {
    background-color: var(--secondary-dark);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--highlight-blue);
    height: 40px;
}

#logo {
    display: flex;
    align-items: center;
}

#logo h1 {
    margin: 0;
    font-size: 18px;
    color: var(--highlight-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#operational-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active .status-dot {
    background-color: var(--success-green);
    box-shadow: 0 0 8px var(--success-green);
}

.status-warning .status-dot {
    background-color: var(--warning-yellow);
    box-shadow: 0 0 8px var(--warning-yellow);
}

.status-alert .status-dot {
    background-color: var(--alert-red);
    box-shadow: 0 0 8px var(--alert-red);
    animation: pulse 2s infinite;
}

/* Main container with map and sidebar */
#main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Map area */
#cesiumContainer {
    flex: 1;
    position: relative;
    height: 100%;
}

/* Command sidebar */
#command-sidebar-right {
    width: 350px;
    background-color: var(--secondary-dark);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--accent-blue);
    overflow: visible;  /* Changed from hidden to allow dropdown to show */
    transition: width 0.3s ease;
}

#command-sidebar-right.collapsed {
    width: 50px;
}

#sidebar-toggle {
    align-self: flex-end;
    background: var(--accent-blue);
    border: none;
    color: var(--text-color);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

/* Tabs in sidebar */
.command-tabs {
    display: flex;
    background-color: var(--accent-blue);
}

.tab-button {
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tab-button.active {
    opacity: 1;
    border-bottom: 3px solid var(--highlight-blue);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;  /* Prevent horizontal overflow */
    padding: 10px;
    min-height: 0;  /* Fix for flex overflow scrolling */
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Navigation Menu Styles */
.nav-menu {
    position: relative;
    margin-bottom: 10px;
    z-index: 1001;  /* Ensure dropdown appears above other content */
}

.menu-button {
    background-color: var(--accent-blue);
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    width: 100%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.menu-button:hover {
    background-color: var(--highlight-blue);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--secondary-dark);
    border: 1px solid var(--accent-blue);
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 9999;  /* Higher z-index to ensure visibility */
    margin-top: 2px;
    max-height: 70vh;  /* Limit height */
    overflow-y: auto;  /* Scroll if too many items */
}

.dropdown-menu.show {
    display: block !important;  /* Force display */
    visibility: visible !important;
    opacity: 1 !important;
}

.dropdown-item {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 12px 15px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(66, 120, 204, 0.2);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--accent-blue);
    color: white;
}

.dropdown-item:active {
    background-color: var(--highlight-blue);
}

/* Quick Access Buttons */
.quick-access {
    margin-bottom: 10px;
}

.quick-btn {
    background-color: var(--alert-red);
    color: white;
    border: none;
    padding: 8px 12px;
    width: 100%;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-btn:hover {
    background-color: #e74c3c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Target Card Styling */
.target-card {
    border-left: 4px solid var(--warning-yellow);
}

.target-card.critical {
    border-left-color: var(--alert-red);
    background-color: rgba(201, 56, 64, 0.1);
}

.target-card.high {
    border-left-color: var(--warning-yellow);
    background-color: rgba(231, 162, 18, 0.1);
}

.target-card.medium {
    border-left-color: var(--highlight-blue);
    background-color: rgba(58, 111, 196, 0.1);
}

.priority-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge.critical {
    background-color: var(--alert-red);
    color: white;
    animation: pulse 2s infinite;
}

.priority-badge.high {
    background-color: var(--warning-yellow);
    color: black;
}

.priority-badge.medium {
    background-color: var(--highlight-blue);
    color: white;
}

.priority-badge.low {
    background-color: var(--text-color);
    color: var(--primary-dark);
}

/* CUDA-inspired visual effects */
@keyframes frequencyPulse {
    0% {
        box-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor, 0 0 40px currentColor;
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
}

@keyframes volumetricGlow {
    0% {
        text-shadow: 0 0 5px currentColor;
    }
    25% {
        text-shadow: 0 0 10px currentColor, 0 0 15px currentColor;
    }
    50% {
        text-shadow: 0 0 15px currentColor, 0 0 20px currentColor, 0 0 25px currentColor;
    }
    75% {
        text-shadow: 0 0 10px currentColor, 0 0 15px currentColor;
    }
    100% {
        text-shadow: 0 0 5px currentColor;
    }
}

@keyframes rayMarch {
    0% {
        background: linear-gradient(45deg, transparent 0%, currentColor 25%, transparent 50%, transparent 100%);
    }
    25% {
        background: linear-gradient(45deg, transparent 25%, currentColor 50%, transparent 75%, transparent 100%);
    }
    50% {
        background: linear-gradient(45deg, transparent 50%, currentColor 75%, transparent 100%, transparent 0%);
    }
    75% {
        background: linear-gradient(45deg, transparent 75%, currentColor 100%, transparent 0%, transparent 25%);
    }
    100% {
        background: linear-gradient(45deg, transparent 100%, currentColor 0%, transparent 25%, transparent 50%);
    }
}

/* Enhanced target styling with CUDA effects */
.target-card.critical {
    border-left-color: var(--alert-red);
    background-color: rgba(201, 56, 64, 0.1);
    animation: frequencyPulse 2s infinite, volumetricGlow 3s infinite;
}

.target-card.high {
    border-left-color: var(--warning-yellow);
    background-color: rgba(231, 162, 18, 0.1);
    animation: frequencyPulse 1.5s infinite;
}

.target-card.medium {
    border-left-color: var(--highlight-blue);
    background-color: rgba(58, 111, 196, 0.1);
    animation: frequencyPulse 3s infinite;
}

/* CUDA-style frequency visualization */
.frequency-display {
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px currentColor;
    animation: volumetricGlow 4s infinite;
}

/* Ray marching effect for action buttons */
.action-button {
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-button:hover::before {
    left: 100%;
}

/* Command console */
#command-console {
    height: 200px;
    background-color: var(--primary-dark);
    border-top: 1px solid var(--accent-blue);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease;
}

#command-console.collapsed {
    height: 30px;
}

/* Console output - scrollable container */
#console-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    font-family: 'Roboto Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    scroll-behavior: smooth;
    max-height: 30vh; /* Limit console height to 30% of viewport */
}

#console-output::-webkit-scrollbar {
    width: 8px;
}

#console-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

#console-output::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

#console-output::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Console line styling */
.console-line {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.console-timestamp {
    color: #666;
    margin-right: 8px;
}

.console-command {
    color: var(--accent-cyan);
}

.console-response {
    color: #aaa;
}

.console-info {
    color: var(--accent-blue);
}

.console-alert {
    color: #ff4444;
}

.console-warning {
    color: #ffaa00;
}

/* Console input container */
#console-input-container {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #333;
}

#console-prompt {
    color: var(--accent-cyan);
    margin-right: 8px;
    font-family: 'Roboto Mono', monospace;
}

#console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    outline: none;
}

#console-input::placeholder {
    color: #555;
}

/* Notifications Container */
#notifications-container,
.notifications {
    position: fixed;
    bottom: 220px; /* Above the console */
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-height: 40vh;
    overflow-y: auto;
    pointer-events: none;
}

#notifications-container > *,
.notifications > * {
    pointer-events: auto;
}

/* Individual Notification */
.notification {
    background: rgba(20, 26, 36, 0.95);
    border-radius: 8px;
    padding: 0;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--accent-blue);
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

.notification.removing {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Notification Types */
.notification-info {
    border-left-color: var(--highlight-blue);
}

.notification-success {
    border-left-color: var(--success-green);
}

.notification-warning {
    border-left-color: var(--warning-yellow);
}

.notification-error {
    border-left-color: var(--alert-red);
}

/* Notification Header */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
}

.notification-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #fff;
}

/* Notification Body */
.notification-body {
    padding: 10px 12px;
    font-size: 12px;
    color: #ccc;
    line-height: 1.5;
}

/* Type-specific title colors */
.notification-info .notification-title {
    color: var(--highlight-blue);
}

.notification-success .notification-title {
    color: var(--success-green);
}

.notification-warning .notification-title {
    color: var(--warning-yellow);
}

.notification-error .notification-title {
    color: var(--alert-red);
}
