/**
 * Air 2S Mission Planner - Complete Enhanced Styles v2.0
 * Save as: assets/css/air2s-styles.css
 */

/* ============================================
   BASE STYLES & RESETS
   ============================================ */

.air2s-planner-wrapper {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.air2s-planner-wrapper * {
    box-sizing: border-box;
}

/* ============================================
   MAP CONTAINER
   ============================================ */

#air2s-map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
}

/* Cesium specific styles */
.cesium-viewer .cesium-viewer-bottom {
    display: none; /* Hide Cesium branding for cleaner look */
}

.cesium-viewer-toolbar {
    top: 10px;
    right: 10px;
}

/* ============================================
   DRAGGABLE GLASS PANEL
   ============================================ */

.air2s-glass-panel {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 340px;
    max-width: 90vw;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease, opacity 0.2s;
}

/* ============================================
   DRAG HANDLE
   ============================================ */

.air2s-drag-handle {
    cursor: grab;
    touch-action: none;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.air2s-drag-handle:active {
    cursor: grabbing;
}

.air2s-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.air2s-icon-title {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.air2s-icon {
    color: #f97316;
    font-size: 18px;
}

.air2s-title {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.05em;
    color: #f1f5f9;
    margin: 0;
    line-height: 1.2;
}

.air2s-subtitle {
    font-size: 10px;
    color: #94a3b8;
    font-family: 'Courier New', 'Courier', monospace;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.air2s-header-buttons {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.air2s-btn-icon {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    font-size: 14px;
    line-height: 1;
}

.air2s-btn-icon:hover {
    color: #f97316;
}

/* ============================================
   PANEL CONTENT
   ============================================ */

.air2s-panel-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.air2s-panel-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    flex: 1;
}

.air2s-panel-scroll::-webkit-scrollbar {
    width: 4px;
}

.air2s-panel-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.air2s-panel-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.air2s-panel-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   STATUS BAR (Fullscreen)
   ============================================ */

.air2s-status-bar {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 11px;
}

/* ============================================
   SECTIONS
   ============================================ */

.air2s-section {
    margin-bottom: 20px;
}

.air2s-section-title {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.air2s-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.air2s-count {
    color: #f97316;
    margin-left: 4px;
    font-weight: bold;
}

.air2s-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

/* ============================================
   INPUTS
   ============================================ */

.air2s-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 4px;
    width: 100%;
    transition: border-color 0.2s, color 0.2s;
    outline: none;
}

.air2s-input:focus {
    border-color: #f97316;
    color: white;
    background: rgba(0, 0, 0, 0.5);
}

.air2s-input::placeholder {
    color: #64748b;
}

.air2s-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* ============================================
   BUTTONS
   ============================================ */

.air2s-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    color: white;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.air2s-btn:active {
    transform: scale(0.98);
}

.air2s-btn-blue {
    background: #2563eb;
}

.air2s-btn-blue:hover {
    background: #3b82f6;
}

.air2s-btn-green {
    background: #16a34a;
}

.air2s-btn-green:hover {
    background: #22c55e;
}

.air2s-btn-text {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}

.air2s-btn-text:hover {
    color: white;
}

/* ============================================
   COORDINATES LIST
   ============================================ */

.air2s-coords-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.air2s-coord-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.air2s-coord-num {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: #334155;
    border: 1px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #cbd5e1;
    font-weight: bold;
}

.air2s-help-text {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    padding-top: 8px;
    line-height: 1.4;
}

.air2s-home-marker {
    color: #22c55e;
    font-weight: bold;
    font-size: 12px;
}

/* ============================================
   SLIDERS
   ============================================ */

.air2s-sliders {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.air2s-slider-group {
    display: flex;
    flex-direction: column;
}

.air2s-slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.air2s-slider-header span:first-child {
    color: #cbd5e1;
}

.air2s-slider-val {
    font-family: 'Courier New', 'Courier', monospace;
    color: #f97316;
    font-weight: 600;
}

.air2s-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.air2s-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f97316;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.air2s-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.air2s-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f97316;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease;
}

.air2s-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* ============================================
   STATS PANEL
   ============================================ */

.air2s-stats-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.air2s-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.air2s-stat {
    display: flex;
    flex-direction: column;
}

.air2s-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.air2s-stat-val {
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 13px;
    color: #f1f5f9;
    font-weight: 600;
}

.air2s-stat-blue {
    color: #93c5fd !important;
}

.air2s-stat-green {
    color: #86efac !important;
}

.air2s-stat-yellow {
    color: #fde047 !important;
}

.air2s-stat-unsafe {
    color: #ef4444 !important;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.air2s-stat-warning {
    color: #f59e0b !important;
    font-weight: bold;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.air2s-stats-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.air2s-stat-right {
    text-align: right;
}

.air2s-stat-time {
    font-size: 18px;
    font-weight: bold;
    color: #f97316;
    line-height: 1;
    font-family: 'Courier New', 'Courier', monospace;
}

/* ============================================
   FOOTER
   ============================================ */

.air2s-footer {
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.air2s-btn-export {
    width: 100%;
    padding: 10px;
    background: #ea580c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s, transform 0.1s;
}

.air2s-btn-export:hover:not(:disabled) {
    background: #f97316;
    transform: translateY(-1px);
}

.air2s-btn-export:active:not(:disabled) {
    transform: translateY(0);
}

.air2s-btn-export:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   MAP CONTROLS
   ============================================ */

.air2s-map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.air2s-map-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.1s;
}

.air2s-map-btn:hover {
    background: #f8fafc;
    transform: scale(1.05);
}

.air2s-map-btn:active {
    transform: scale(0.95);
}

/* ============================================
   HOME MARKER ICON
   ============================================ */

.air2s-home-icon {
    background-color: #22c55e;
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: sans-serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    font-size: 14px;
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */

.air2s-fullscreen-mode {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.air2s-exit-fullscreen {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.air2s-exit-fullscreen:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
    .air2s-glass-panel {
        width: 320px;
    }
    
    .air2s-panel-content {
        max-height: 75vh;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) {
    .air2s-glass-panel {
        width: calc(100vw - 20px);
        left: 10px;
        top: 10px;
        max-width: none;
    }
    
    .air2s-panel-content {
        max-height: 70vh;
    }
    
    .air2s-stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .air2s-map-controls {
        top: auto;
        bottom: 16px;
        right: 16px;
        flex-direction: row;
    }
    
    .air2s-input-row {
        flex-wrap: wrap;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .air2s-glass-panel {
        width: 300px;
        left: 10px;
        top: 10px;
    }
    
    .air2s-panel-content {
        max-height: calc(100vh - 100px);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .air2s-glass-panel {
        width: calc(100vw - 16px);
        left: 8px;
        top: 8px;
    }
    
    .air2s-title {
        font-size: 12px;
    }
    
    .air2s-subtitle {
        font-size: 9px;
    }
    
    .air2s-panel-scroll {
        padding: 12px;
    }
    
    .air2s-section {
        margin-bottom: 16px;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode by default */
}

/* Light mode override (if needed) */
@media (prefers-color-scheme: light) {
    .air2s-glass-panel {
        background: rgba(255, 255, 255, 0.95);
        color: #1e293b;
    }
    
    .air2s-title,
    .air2s-stat-val,
    .air2s-slider-header span:first-child {
        color: #1e293b;
    }
    
    .air2s-input {
        background: rgba(0, 0, 0, 0.05);
        color: #1e293b;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .air2s-glass-panel,
    .air2s-map-controls {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus indicators */
.air2s-input:focus,
.air2s-btn:focus,
.air2s-slider:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .air2s-glass-panel {
        border: 2px solid white;
    }
    
    .air2s-input,
    .air2s-btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.air2s-hidden {
    display: none !important;
}

.air2s-invisible {
    visibility: hidden !important;
}

.air2s-loading {
    opacity: 0.5;
    pointer-events: none;
}

.air2s-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes air2s-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes air2s-slide-up {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.air2s-animate-in {
    animation: air2s-fade-in 0.3s ease-out;
}

.air2s-slide-up {
    animation: air2s-slide-up 0.3s ease-out;
}

/* ============================================
   CUSTOM SCROLLBAR (Webkit)
   ============================================ */

.air2s-panel-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* ============================================
   LOADING STATES
   ============================================ */

.air2s-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #f97316;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   TOOLTIPS (Optional Enhancement)
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10000;
    margin-bottom: 5px;
}

/* ============================================
   END OF STYLES
   ============================================ */