/**
 * ═══════════════════════════════════════════════════════════════════════════
 * 🚀 THIBEQUATION FRAMEWORK V2.0-BETA
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * TRAJECTORY UI - STYLES COSMIQUES
 * Design spectaculaire pour interface trajectoires RK4/Monte-Carlo
 * 
 * @author Thib - Développeur-Chercheur en Analyse Mathématique Interstellaire
 * @version 2.0.0-BETA
 * @license MIT
 * 
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   🌌 CONTAINER PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-ui {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

.trajectory-ui--cosmic {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* Starfield animé */
.trajectory-ui--cosmic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: trajectoryStarsMove 40s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes trajectoryStarsMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(100px, 100px);
    }
}

.trajectory-ui__content {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📤 DROP ZONE
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-drop-zone {
    border: 3px dashed rgba(102, 126, 234, 0.5);
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 24px;
}

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

.trajectory-drop-zone:hover::before {
    left: 100%;
}

.trajectory-drop-zone:hover {
    border-color: rgba(102, 126, 234, 0.8);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.trajectory-drop-zone.drag-over {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.3);
}

.trajectory-drop-zone__icon {
    font-size: 64px;
    color: #667eea;
    margin-bottom: 16px;
    animation: trajectoryIconFloat 3s ease-in-out infinite;
}

@keyframes trajectoryIconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.trajectory-drop-zone__title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.trajectory-drop-zone__description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.trajectory-drop-zone__input {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎛️ TYPE SELECTOR
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.trajectory-type-option {
    flex: 1;
    min-width: 200px;
}

.trajectory-type-option input[type="radio"] {
    display: none;
}

.trajectory-type-option label {
    display: block;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.trajectory-type-option label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.6);
}

.trajectory-type-option input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.trajectory-type-option label i {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📊 FILE INFO PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-file-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.trajectory-file-info__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.trajectory-file-info__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trajectory-file-info__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.trajectory-file-info__value {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
}

.trajectory-file-info__value--highlight {
    color: #FFD700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎬 ANIMATION CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-controls {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.trajectory-controls__title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trajectory-controls__title i {
    color: #667eea;
}

.trajectory-controls__buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.trajectory-control-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trajectory-control-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.trajectory-control-button:hover::before {
    width: 300px;
    height: 300px;
}

.trajectory-control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.trajectory-control-button:active {
    transform: scale(0.95);
}

.trajectory-control-button i {
    position: relative;
    z-index: 1;
}

.trajectory-control-button span {
    position: relative;
    z-index: 1;
}

.trajectory-control-button--secondary {
    background: rgba(255, 255, 255, 0.1);
}

.trajectory-control-button--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⏱️ TIME SCRUBBER
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-time-scrubber-container {
    margin-bottom: 20px;
}

.trajectory-time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.trajectory-time-scrubber {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    appearance: none;
    cursor: pointer;
    position: relative;
}

.trajectory-time-scrubber::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: all 0.3s;
}

.trajectory-time-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.trajectory-time-scrubber::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: all 0.3s;
    border: none;
}

.trajectory-time-scrubber::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎚️ SPEED CONTROL
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-speed-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trajectory-speed-control__label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    min-width: 120px;
}

.trajectory-speed-control__slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.trajectory-speed-control__slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.trajectory-speed-control__slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.6);
}

.trajectory-speed-control__value {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    color: #FFD700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📈 2D PREVIEW PLOTS
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-preview-plots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.trajectory-plot-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 16px;
    min-height: 300px;
    transition: all 0.3s;
}

.trajectory-plot-container:hover {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.trajectory-plot-container__title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trajectory-plot-container__title i {
    color: #667eea;
}

.trajectory-plot-container canvas {
    width: 100% !important;
    height: 250px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚙️ VISUALIZATION SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-settings {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.trajectory-settings__title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trajectory-settings__title i {
    color: #667eea;
}

.trajectory-settings__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.trajectory-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.trajectory-setting-item__label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Toggle Switch */
.trajectory-toggle {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.trajectory-toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.trajectory-toggle.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.trajectory-toggle.active::before {
    transform: translateX(26px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 3D CANVAS CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-canvas-container {
    width: 100%;
    height: 600px;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    position: relative;
}

.trajectory-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.trajectory-canvas-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⏳ LOADING STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 16px;
}

.trajectory-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: trajectorySpinnerRotate 1s linear infinite;
}

@keyframes trajectorySpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

.trajectory-loading__text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚠️ ERROR STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-error {
    background: rgba(255, 87, 87, 0.1);
    border: 2px solid rgba(255, 87, 87, 0.5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.trajectory-error__title {
    font-size: 18px;
    font-weight: 700;
    color: #ff5757;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trajectory-error__message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✅ SUCCESS STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-success {
    background: rgba(87, 242, 135, 0.1);
    border: 2px solid rgba(87, 242, 135, 0.5);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trajectory-success i {
    font-size: 24px;
    color: #57f287;
}

.trajectory-success__message {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📱 RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .trajectory-ui {
        padding: 16px;
    }

    .trajectory-drop-zone {
        padding: 32px 16px;
    }

    .trajectory-drop-zone__icon {
        font-size: 48px;
    }

    .trajectory-drop-zone__title {
        font-size: 20px;
    }

    .trajectory-type-selector {
        flex-direction: column;
    }

    .trajectory-type-option {
        min-width: 100%;
    }

    .trajectory-controls__buttons {
        flex-direction: column;
    }

    .trajectory-control-button {
        width: 100%;
        justify-content: center;
    }

    .trajectory-preview-plots {
        grid-template-columns: 1fr;
    }

    .trajectory-settings__grid {
        grid-template-columns: 1fr;
    }

    .trajectory-canvas-container {
        height: 400px;
    }

    .trajectory-speed-control {
        flex-direction: column;
        align-items: stretch;
    }

    .trajectory-speed-control__label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .trajectory-drop-zone__title {
        font-size: 18px;
    }

    .trajectory-drop-zone__description {
        font-size: 14px;
    }

    .trajectory-canvas-container {
        height: 300px;
    }

    .trajectory-file-info__grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ♿ ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-control-button:focus,
.trajectory-time-scrubber:focus,
.trajectory-speed-control__slider:focus,
.trajectory-toggle:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

.trajectory-type-option input[type="radio"]:focus + label {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎬 REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .trajectory-ui--cosmic::before,
    .trajectory-drop-zone__icon,
    .trajectory-drop-zone::before,
    .trajectory-control-button::before,
    .trajectory-time-scrubber::-webkit-slider-thumb,
    .trajectory-time-scrubber::-moz-range-thumb,
    .trajectory-speed-control__slider::-webkit-slider-thumb,
    .trajectory-spinner,
    .trajectory-toggle::before {
        animation: none !important;
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 DARK MODE (par défaut)
   ═══════════════════════════════════════════════════════════════════════════ */

.trajectory-ui {
    color-scheme: dark;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✨ UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

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

.trajectory-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.trajectory-fade-in {
    animation: trajectoryFadeIn 0.5s ease-out;
}

@keyframes trajectoryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trajectory-pulse {
    animation: trajectoryPulse 2s ease-in-out infinite;
}

@keyframes trajectoryPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
