/* ========================================
   ODYSSEY LOADER — Immersive Loading Screen
   ======================================== */

#odyssey-loader {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 20, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#odyssey-loader.visible {
    opacity: 1;
}

#odyssey-loader-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---- Content Container ---- */
.odl-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
}

/* ---- Orbital Atom Animation ---- */
.odl-orbital {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 0.5rem;
}

.odl-nucleus {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #00d4ff, #7c3aed);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.5),
        0 0 60px rgba(0, 212, 255, 0.15);
    animation: nucleus-pulse 2s ease-in-out infinite;
}

@keyframes nucleus-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5), 0 0 60px rgba(0, 212, 255, 0.15); }
    50% { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 30px rgba(0, 212, 255, 0.7), 0 0 80px rgba(0, 212, 255, 0.25); }
}

.odl-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 50%;
}

.odl-ring-1 {
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    animation: orbit-tilt-1 3s linear infinite;
}
.odl-ring-2 {
    width: 88px;
    height: 88px;
    margin: -44px 0 0 -44px;
    animation: orbit-tilt-2 4.5s linear infinite;
    border-color: rgba(124, 58, 237, 0.15);
}
.odl-ring-3 {
    width: 116px;
    height: 116px;
    margin: -58px 0 0 -58px;
    animation: orbit-tilt-3 6s linear infinite;
    border-color: rgba(0, 212, 255, 0.08);
}

.odl-electron {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: -4px;
    left: 50%;
    margin-left: -4px;
    background: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.3);
}

.odl-ring-2 .odl-electron {
    background: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.8), 0 0 30px rgba(124, 58, 237, 0.3);
    width: 6px;
    height: 6px;
    top: -3px;
    margin-left: -3px;
}

.odl-ring-3 .odl-electron {
    width: 5px;
    height: 5px;
    top: -2.5px;
    margin-left: -2.5px;
    opacity: 0.7;
}

@keyframes orbit-tilt-1 {
    0%   { transform: rotateX(65deg) rotateZ(0deg); }
    100% { transform: rotateX(65deg) rotateZ(360deg); }
}
@keyframes orbit-tilt-2 {
    0%   { transform: rotateX(50deg) rotateY(30deg) rotateZ(0deg); }
    100% { transform: rotateX(50deg) rotateY(30deg) rotateZ(-360deg); }
}
@keyframes orbit-tilt-3 {
    0%   { transform: rotateX(75deg) rotateY(-20deg) rotateZ(0deg); }
    100% { transform: rotateX(75deg) rotateY(-20deg) rotateZ(360deg); }
}

/* ---- Title & Subtitle ---- */
.odl-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #fff 0%, #00d4ff 60%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.odl-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: -0.5rem 0 0 0;
    min-height: 1.2em;
    transition: opacity 0.3s;
}

/* ---- Step List ---- */
.odl-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
}

.odl-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    opacity: 0.35;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.odl-step.active {
    opacity: 1;
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.05);
}

.odl-step.done {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(52, 211, 153, 0.15);
}

.odl-step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.4s;
}

.odl-step.active .odl-step-icon {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.odl-step.done .odl-step-icon {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.odl-step-body {
    flex: 1;
    min-width: 0;
}

.odl-step-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.4s;
}

.odl-step.active .odl-step-label {
    color: #fff;
}

.odl-step.done .odl-step-label {
    color: rgba(52, 211, 153, 0.85);
}

.odl-step-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    line-height: 1.3;
    margin-top: 0.15rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s, color 0.4s, margin 0.4s;
}

.odl-step.active .odl-step-desc {
    max-height: 3em;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.2rem;
}

/* Status indicators */
.odl-step-status {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.odl-check, .odl-spin {
    display: none;
    font-size: 0.8rem;
}

.odl-step.active .odl-spin {
    display: block;
    color: #00d4ff;
}

.odl-step.done .odl-check {
    display: block;
    color: #34d399;
    animation: check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes check-pop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Progress Bar ---- */
.odl-bar-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.odl-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

/* ---- Timer ---- */
.odl-timer {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.25);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* ---- Tip ---- */
.odl-tip {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    max-width: 400px;
    min-height: 2.2em;
    line-height: 1.4;
    transition: opacity 0.3s;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .odl-orbital {
        width: 90px;
        height: 90px;
    }
    .odl-ring-1 { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
    .odl-ring-2 { width: 66px; height: 66px; margin: -33px 0 0 -33px; }
    .odl-ring-3 { width: 88px; height: 88px; margin: -44px 0 0 -44px; }
    .odl-nucleus { width: 14px; height: 14px; }
    .odl-title { font-size: 1.25rem; }
    .odl-step { padding: 0.5rem 0.65rem; gap: 0.5rem; }
    .odl-step-icon { width: 28px; height: 28px; font-size: 0.75rem; }
    .odl-step-label { font-size: 0.78rem; }
    .odl-step-desc { font-size: 0.65rem; }
    .odl-tip { font-size: 0.65rem; }
}

/* ---- Light Theme ---- */
.light-theme #odyssey-loader {
    background: rgba(240, 242, 250, 0.97);
}

.light-theme .odl-title {
    background: linear-gradient(135deg, #1a1f3e 0%, #1a73e8 60%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.light-theme .odl-subtitle { color: rgba(0, 0, 0, 0.45); }
.light-theme .odl-step { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.06); }
.light-theme .odl-step.active { background: rgba(26, 115, 232, 0.06); border-color: rgba(26, 115, 232, 0.2); }
.light-theme .odl-step.done { border-color: rgba(52, 211, 153, 0.2); }
.light-theme .odl-step-icon { background: rgba(0, 0, 0, 0.04); color: rgba(0, 0, 0, 0.3); }
.light-theme .odl-step.active .odl-step-icon { background: rgba(26, 115, 232, 0.12); color: #1a73e8; }
.light-theme .odl-step-label { color: rgba(0, 0, 0, 0.5); }
.light-theme .odl-step.active .odl-step-label { color: #1a1f3e; }
.light-theme .odl-step-desc { color: rgba(0, 0, 0, 0.25); }
.light-theme .odl-step.active .odl-step-desc { color: rgba(0, 0, 0, 0.45); }
.light-theme .odl-bar-track { background: rgba(0, 0, 0, 0.06); }
.light-theme .odl-timer { color: rgba(0, 0, 0, 0.25); }
.light-theme .odl-tip { color: rgba(0, 0, 0, 0.35); }
