/**
 * Training Overlay System
 * Modular components that overlay on existing SDA simulation
 * These elements wrap around the existing 3D scene
 */

/* Training Mode Activation */
body.training-mode {
    overflow: hidden;
}

/* Hide standard UI elements when in training mode */
body.training-mode #sda-toggle-btn,
body.training-mode #simulation-settings-btn,
body.training-mode #add-tle-button,
body.training-mode #telemetry-dashboard-btn,
body.training-mode #data-source-btn,
body.training-mode #leos-dial,
body.training-mode .regular-controls {
    display: none !important;
}

/* Training Module Container */
.training-modules {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 8000;
}

.training-modules.active {
    pointer-events: none;
}

.training-modules > * {
    pointer-events: auto;
}

/* Module: Top Info Bar */
.training-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, rgba(10, 14, 39, 0.95) 0%, rgba(10, 14, 39, 0.85) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(100, 200, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.training-modules.active .training-topbar {
    transform: translateY(0);
}

.training-title {
    font-size: 1.125rem;
    color: #ffffff;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.training-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.progress-bar {
    width: 150px;
    height: 4px;
    background: rgba(100, 200, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #64b5f6 100%);
    transition: width 0.5s ease;
}

/* Module: Context Panel (Left) */
.training-context {
    position: absolute;
    left: 20px;
    top: 70px;
    width: 300px;
    max-height: 400px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.92) 0%, rgba(15, 20, 40, 0.92) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.12);
    border-radius: 8px;
    padding: 1.25rem;
    transform: translateX(-120%);
    transition: transform 0.4s ease;
    overflow-y: auto;
}

.training-modules.active .training-context {
    transform: translateX(0);
}

.context-header {
    color: #64b5f6;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.context-content {
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.highlight-item {
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: rgba(100, 181, 246, 0.1);
    border-left: 3px solid #64b5f6;
    border-radius: 4px;
}

/* Module: Data Display (Right) */
.training-data {
    position: absolute;
    right: 20px;
    top: 70px;
    width: 320px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.92) 0%, rgba(15, 20, 40, 0.92) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.12);
    border-radius: 8px;
    padding: 1.25rem;
    transform: translateX(120%);
    transition: transform 0.4s ease;
}

.training-modules.active .training-data {
    transform: translateX(0);
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.data-item {
    background: rgba(10, 15, 30, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.08);
    border-radius: 4px;
    padding: 0.625rem;
}

.data-label {
    font-size: 0.625rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

.data-value {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.data-unit {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 0.25rem;
}

/* Module: Instruction Callout */
.training-callout {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 450px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.98) 0%, rgba(15, 20, 40, 0.98) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.training-modules.active .training-callout {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.callout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.callout-step {
    color: #64b5f6;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.callout-close {
    width: 20px;
    height: 20px;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64b5f6;
    font-size: 0.875rem;
}

.callout-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.callout-text {
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.callout-actions {
    display: flex;
    gap: 0.75rem;
}

.callout-btn {
    flex: 1;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.callout-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.callout-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
}

/* Module: Pointer/Arrow System */
.training-pointer {
    position: absolute;
    width: 200px;
    pointer-events: none;
    z-index: 9500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.training-pointer.active {
    opacity: 1;
}

.pointer-line {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #64b5f6 100%);
    transform-origin: left center;
}

.pointer-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #64b5f6;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: pulse-pointer 2s infinite;
}

@keyframes pulse-pointer {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(100, 181, 246, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(100, 181, 246, 0);
        transform: scale(1.1);
    }
}

.pointer-label {
    position: absolute;
    background: rgba(10, 14, 39, 0.95);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    color: #ffffff;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-left: 20px;
}

/* Module: Bottom Controls */
.training-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.92) 0%, rgba(15, 20, 40, 0.92) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 200, 255, 0.12);
    border-radius: 8px;
    transition: transform 0.4s ease;
}

.training-modules.active .training-controls {
    transform: translateX(-50%) translateY(0);
}

.control-btn {
    padding: 0.5rem 1rem;
    background: rgba(30, 35, 55, 0.8);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(100, 200, 255, 0.4);
    transform: translateY(-1px);
}

/* Module: Mini Status Bar */
.training-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(10, 14, 39, 0.95);
    border-top: 1px solid rgba(100, 200, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: center;
    gap: 2rem;
    font-size: 0.75rem;
    color: #64748b;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.training-modules.active .training-status {
    transform: translateY(0);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.status-value {
    color: #e2e8f0;
    font-weight: 600;
}

/* Animation classes for highlighting elements */
.highlight-satellite {
    animation: highlight-pulse 2s infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 10px rgba(100, 181, 246, 0.5));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 20px rgba(100, 181, 246, 0.8));
    }
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .training-context,
    .training-data {
        width: 280px;
    }

    .training-callout {
        width: 90%;
        max-width: 400px;
    }
}