/* LEOS Mission Ready Interface - Updated for SDA & Learning Focus */

.mission-ready-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    background: #0a0e27;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    z-index: 1;
    pointer-events: auto !important;
}

/* Fix for mission control stat tiles - override brand-ui.css */
.mission-control-dashboard .mission-dashboard-tile {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Sidebar Navigation */
.sidebar-navigation {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    position: relative;
}

.sidebar-navigation.collapsed {
    width: 80px;
}

/* Expand/Collapse button - always visible */
.sidebar-navigation::after {
    content: '⟨';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-left: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 101;
}

.sidebar-navigation::after:hover {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
}

.sidebar-navigation.collapsed::after {
    content: '⟩';
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-logo {
    width: 56px;
    height: 56px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 8px;
}

.app-tier {
    font-size: 10px;
    font-weight: 600;
    color: #00d4ff;
    letter-spacing: 1px;
    text-transform: uppercase;
}


.user-profile {
    padding: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-profile:hover {
    background: rgba(148, 163, 184, 0.05);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.3);
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: #94a3b8;
}

/* Status indicator removed - only showing connection status in top bar */

/* Main Navigation */
.main-navigation {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(148, 163, 184, 0.05);
}

.nav-item.active {
    background: rgba(0, 153, 255, 0.1);
    border-left: 3px solid #0099ff;
}

.nav-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    filter: brightness(0) saturate(100%) invert(69%) sepia(8%) saturate(507%) hue-rotate(185deg) brightness(89%) contrast(87%);
    transition: filter 0.2s ease;
}

.nav-item:hover .nav-icon img,
.nav-item.active .nav-icon img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.nav-content {
    flex: 1;
    min-width: 0;
}

.nav-label {
    font-size: 15px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.nav-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.nav-lock {
    font-size: 16px;
    color: #64748b;
}

/* Upgrade Prompt */
.upgrade-prompt {
    margin: 20px;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(0, 153, 255, 0.1), rgba(0, 212, 255, 0.05));
    border: 1px solid rgba(0, 153, 255, 0.3);
    border-radius: 16px;
    text-align: center;
}

.upgrade-content h4 {
    color: #00d4ff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.upgrade-content p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.upgrade-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

.upgrade-features li {
    color: #e2e8f0;
    font-size: 13px;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.upgrade-features li:before {
    content: '';
    width: 14px;
    height: 14px;
    position: absolute;
    left: 0;
    background-image: url('../assets/sat.svg');
    background-size: contain;
    background-repeat: no-repeat;
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.upgrade-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 153, 255, 0.3);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    width: 100%;
}

.top-bar {
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.current-section h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0 0 4px 0;
}

.current-section p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.top-bar-controls {
    display: flex;
    align-items: center;
    gap: 32px;
}

.simulation-time {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-label {
    color: #64748b;
    font-size: 14px;
}

.time-value {
    color: #00d4ff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow: auto; /* Change to auto for proper scrolling */
    padding: 0;
    position: relative;
    height: 100%;
    pointer-events: auto !important;
    min-width: 0; /* Prevent flex items from overflowing */
}

/* Ensure all overlays are contained within simulation window */
.content-area .sda-overlay,
.content-area .telemetry-dashboard,
.content-area .data-source-manager,
.content-area .modal-overlay {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

/* Space Domain Awareness Dashboard */
.sda-dashboard {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 32px;
    height: 100%;
}

.sda-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 24px;
}

.control-panel h3 {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.sda-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sda-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sda-btn:hover {
    background: rgba(0, 153, 255, 0.1);
    border-color: rgba(0, 153, 255, 0.3);
    color: #00d4ff;
}

.sda-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) saturate(100%) invert(69%) sepia(8%) saturate(507%) hue-rotate(185deg) brightness(89%) contrast(87%);
}

.sda-btn:hover img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.sda-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.visualization-container {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* Ensure overlays within visualization container are properly contained */
.visualization-container > .sda-overlay,
.visualization-container > .telemetry-dashboard,
.visualization-container > [class*="overlay"],
.visualization-container > [class*="modal"] {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    overflow: auto;
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    pointer-events: auto !important;
}

/* Mission Hub */
.mission-hub-dashboard {
    max-width: 1200px;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.mission-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.mission-card:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mission-card.locked {
    opacity: 0.6;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.mission-header h3 {
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.mission-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mission-status.in-progress {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.mission-status.ready {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mission-status.locked {
    background: rgba(100, 116, 139, 0.2);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.mission-description {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.mission-objectives h4 {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.mission-objectives ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.mission-objectives li {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-objectives li.completed {
    color: #10b981;
}

.mission-objectives li.active {
    color: #00d4ff;
}

.obj-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.obj-icon.completed {
    filter: brightness(0) saturate(100%) invert(64%) sepia(37%) saturate(4162%) hue-rotate(121deg) brightness(94%) contrast(85%);
}

.obj-icon.active {
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.obj-icon.pending {
    filter: brightness(0) saturate(100%) invert(69%) sepia(8%) saturate(507%) hue-rotate(185deg) brightness(89%) contrast(87%);
}

.mission-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.mission-meta span {
    color: #64748b;
    font-size: 13px;
}

.mission-btn {
    padding: 8px 16px;
    background: rgba(0, 153, 255, 0.2);
    border: 1px solid rgba(0, 153, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mission-btn:hover {
    background: rgba(0, 153, 255, 0.3);
}

/* Learning Center */
.learning-center {
    max-width: 1200px;
}

.learning-header {
    margin-bottom: 40px;
}

.learning-header h2 {
    color: #e2e8f0;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.learning-header p {
    color: #94a3b8;
    font-size: 16px;
    margin: 0;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.course-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.course-card:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.course-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(0, 153, 255, 0.1);
    border: 1px solid rgba(0, 153, 255, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-icon img {
    width: 32px;
    height: 32px;
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(2044%) hue-rotate(178deg) brightness(102%) contrast(101%);
}

.course-card h3 {
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.course-card p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.course-progress {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.course-progress span {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.course-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(0, 153, 255, 0.2);
    border: 1px solid rgba(0, 153, 255, 0.3);
    border-radius: 10px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.course-btn:hover {
    background: rgba(0, 153, 255, 0.3);
    transform: translateY(-1px);
}

/* Collapsed Sidebar Styles */
.sidebar-navigation.collapsed .logo-text,
.sidebar-navigation.collapsed .user-info,
.sidebar-navigation.collapsed .nav-content,
.sidebar-navigation.collapsed .nav-description,
.sidebar-navigation.collapsed .upgrade-prompt {
    display: none;
}

.sidebar-navigation.collapsed .nav-item {
    justify-content: center;
    padding: 16px;
    position: relative;
}

.sidebar-navigation.collapsed .user-profile {
    justify-content: center;
    padding: 16px;
}

.sidebar-navigation.collapsed .sidebar-header {
    padding: 20px 16px;
    justify-content: center;
}

.sidebar-navigation.collapsed .logo-section {
    justify-content: center;
    align-items: center;
}

.sidebar-navigation.collapsed .sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -40px; /* Move button outside the sidebar */
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-navigation.collapsed .nav-logo {
    width: 40px;
    height: 40px;
}

/* Hover tooltips for collapsed state */
.sidebar-navigation.collapsed .nav-item:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-left: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Fix for renderCanvas blocking clicks in Mission Ready mode */
body.mission-ready-mode #renderCanvas-container {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
    pointer-events: auto !important;
}

body.mission-ready-mode #renderCanvas {
    z-index: 0 !important;
    pointer-events: auto !important;
}

/* Ensure Mission Ready interface is always on top and clickable */
body.mission-ready-mode #mission-ready-interface {
    z-index: 10 !important;
    pointer-events: auto !important;
}

body.mission-ready-mode .mission-ready-interface * {
    pointer-events: auto !important;
}

/* Responsive Design */
@media (max-width: 1400px) {
    /* Mission control responsive adjustments */
    .mission-control-dashboard {
        grid-template-columns: 1fr !important;
    }
    
    .mission-control-dashboard > div:last-child {
        position: fixed;
        right: 0;
        top: 60px;
        width: 380px;
        height: calc(100vh - 60px);
        background: rgba(15, 23, 42, 0.95);
        border-left: 1px solid rgba(148, 163, 184, 0.2);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    /* Show/hide toggle for right sidebar */
    .mission-control-dashboard > div:last-child.show {
        transform: translateX(0);
    }
}

@media (max-width: 1024px) {
    .sda-dashboard {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .sda-controls {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sda-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Mission control stat tiles responsive */
    .mission-control-dashboard .stat-card {
        min-width: 200px;
    }
    
    /* Make stat tiles scrollable horizontally */
    .mission-control-dashboard > div:first-child > div:first-child {
        display: flex !important;
        overflow-x: auto;
        overflow-y: visible;
        gap: 12px;
        padding-bottom: 12px;
    }
    
    /* Hide stat tile descriptions on smaller screens */
    .stat-card > div:last-child {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar-navigation {
        width: 100%;
        position: absolute;
        left: -100%;
        transition: left 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar-navigation.open {
        left: 0;
    }
    
    /* Add mobile menu toggle button */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1002;
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-radius: 8px;
        padding: 8px;
        cursor: pointer;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .top-bar {
        padding: 0 20px;
        padding-left: 60px; /* Space for mobile menu toggle */
    }
    
    /* Make tiles stack vertically on mobile */
    .mission-control-dashboard {
        padding: 10px !important;
    }
    
    .mission-control-dashboard > div:first-child > div:first-child {
        flex-direction: column !important;
        overflow-x: visible !important;
    }
    
    .mission-control-dashboard .stat-card {
        width: 100% !important;
        min-width: unset !important;
    }
    
    .mission-grid,
    .course-grid {
        grid-template-columns: 1fr;
    }
}

/* Time Controls Styles */
.time-controls-panel {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(102, 217, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.time-controls-panel.hidden {
    display: none !important;
}

.time-btn {
    padding: 8px 12px;
    margin: 0 4px;
    background: rgba(102, 217, 255, 0.1);
    border: 1px solid rgba(102, 217, 255, 0.3);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn:hover {
    background: rgba(102, 217, 255, 0.2);
    color: #66d9ff;
    border-color: rgba(102, 217, 255, 0.5);
}

.time-btn.active {
    background: rgba(102, 217, 255, 0.3);
    color: #66d9ff;
    border-color: #66d9ff;
    box-shadow: 0 0 8px rgba(102, 217, 255, 0.3);
}

.speed-buttons {
    display: flex;
    justify-content: center;
    gap: 4px;
}

/* Floating action buttons */
.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(102, 217, 255, 0.3);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.floating-btn:hover {
    background: rgba(102, 217, 255, 0.2);
    border-color: #66d9ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 217, 255, 0.3);
}


