/* login.css - Cosmic background, moon, ship animation, login card */

.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1a0f 0%, #0d2818 30%, #0a1a0f 70%, #061208 100%);
    position: relative;
    overflow: hidden;
}

/* Cosmic background layers */
.cosmic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    animation: cosmicFadeIn 2s ease-out 2s forwards;
    opacity: 0;
}

@keyframes cosmicFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Stars layer */
.stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(150,255,150,0.6) 40%, transparent 70%);
    animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
}

.star.green {
    background: radial-gradient(circle, rgba(200,255,200,1) 0%, rgba(30, 99, 50,0.7) 40%, transparent 70%);
}

.star.bright {
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(150,255,180,0.8) 30%, rgba(30, 99, 50,0.4) 60%, transparent 80%);
    box-shadow: 0 0 10px rgba(30, 99, 50,0.5), 0 0 20px rgba(30, 99, 50,0.3);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes twinkleFade {
    0% { opacity: 0; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Aurora layer */
.aurora-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

.aurora {
    position: absolute;
    width: 150%;
    height: 60%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: auroraFloat 15s ease-in-out infinite;
}

.aurora-1 {
    background: radial-gradient(ellipse, rgba(30, 99, 50,0.4) 0%, rgba(16,185,129,0.2) 40%, transparent 70%);
    top: -20%;
    left: -25%;
    animation-delay: 0s;
}

.aurora-2 {
    background: radial-gradient(ellipse, rgba(16,185,129,0.3) 0%, rgba(30, 99, 50,0.2) 40%, transparent 70%);
    top: 60%;
    left: 50%;
    animation-delay: -5s;
    width: 120%;
    height: 50%;
}

.aurora-3 {
    background: radial-gradient(ellipse, rgba(47, 133, 66,0.25) 0%, rgba(30, 99, 50,0.15) 40%, transparent 70%);
    top: 20%;
    left: -10%;
    animation-delay: -10s;
    width: 100%;
    height: 40%;
}

@keyframes auroraFloat {
    0%, 100% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(1);
    }
    25% {
        opacity: 0.6;
        transform: translateX(5%) translateY(-5%) scale(1.1);
    }
    50% {
        opacity: 0.4;
        transform: translateX(10%) translateY(5%) scale(1.05);
    }
    75% {
        opacity: 0.7;
        transform: translateX(3%) translateY(-3%) scale(1.15);
    }
}

/* Nebula glow spots */
.nebula-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    animation: nebulaGlow 20s ease-in-out infinite;
}

@keyframes nebulaGlow {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Shooting star */
.shooting-star {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, rgba(30, 99, 50,0), rgba(150,255,150,0.8), rgba(255,255,255,1));
    border-radius: 50%;
    opacity: 0;
    transform-origin: left center;
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(var(--angle, -45deg));
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(300px) translateY(200px) rotate(var(--angle, -45deg));
    }
}

/* ==================== MOON IN THE DISTANCE (Using moon.png) ==================== */
.space-moon {
    position: absolute;
    top: -2%;
    right: 2%;
    width: 280px;
    height: 280px;
    z-index: 1;
    opacity: 1;
    animation: moonPulse 12s ease-in-out infinite;
}

/* Moon size pulsing animation */
@keyframes moonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

/* Main moon image with realistic soft glow */
.moon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.5))
        drop-shadow(0 0 25px rgba(220, 235, 255, 0.35))
        drop-shadow(0 0 50px rgba(200, 220, 250, 0.25));
    animation: moonGlow 6s ease-in-out infinite;
}

/* Moon glow breathing animation */
@keyframes moonGlow {
    0%, 100% {
        filter:
            drop-shadow(0 0 10px rgba(255, 255, 255, 0.5))
            drop-shadow(0 0 25px rgba(220, 235, 255, 0.35))
            drop-shadow(0 0 50px rgba(200, 220, 250, 0.25));
    }
    50% {
        filter:
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.7))
            drop-shadow(0 0 35px rgba(220, 235, 255, 0.5))
            drop-shadow(0 0 70px rgba(200, 220, 250, 0.35));
    }
}

/* Hide fake lighting effects */
.moon-shimmer,
.moon-highlight {
    display: none;
}

/* ==================== EFF SHIP (Using SpaceShip.png) ==================== */
.eff-ship-container {
    position: fixed;
    bottom: 25%;
    left: 5%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

/* When launching class is added, ship becomes visible and animates */
.eff-ship-container.launching {
    opacity: 1;
}

.eff-ship {
    position: relative;
}

/* Idle floating animation - subtle zoom in/out when ship reaches destination */
.eff-ship.ship-idle {
    animation: shipIdle 4s ease-in-out infinite;
}

@keyframes shipIdle {
    0%, 100% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.08) translate(2px, -2px);
    }
}

/* Main spaceship image */
.ship-image {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(47, 133, 66, 0.4));
    position: relative;
    z-index: 2;
}

/* Engine exhaust container - positioned at back of ship */
.ship-exhaust {
    position: absolute;
    bottom: 18px;
    left: 8px;
    width: 40px;
    height: 25px;
    transform: rotate(-45deg);
    z-index: 1;
}

/* Individual flame elements */
.exhaust-flame {
    position: absolute;
    border-radius: 50% 20% 50% 20%;
    filter: blur(1px);
    transform-origin: right center;
}

/* Core flame - bright white/cyan center */
.exhaust-flame.flame-1 {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 8px;
    background: linear-gradient(to left,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(180, 255, 220, 0.9) 30%,
        rgba(80, 220, 140, 0.7) 70%,
        transparent 100%);
    animation: flameCore 0.05s ease-in-out infinite alternate;
}

/* Middle flame - green/teal */
.exhaust-flame.flame-2 {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 12px;
    background: linear-gradient(to left,
        rgba(100, 255, 180, 0.8) 0%,
        rgba(47, 133, 66, 0.6) 40%,
        rgba(20, 150, 80, 0.3) 80%,
        transparent 100%);
    animation: flameMiddle 0.07s ease-in-out infinite alternate;
}

/* Outer flame - fading trail */
.exhaust-flame.flame-3 {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 16px;
    background: linear-gradient(to left,
        rgba(47, 133, 66, 0.5) 0%,
        rgba(47, 133, 66, 0.2) 50%,
        transparent 100%);
    animation: flameOuter 0.1s ease-in-out infinite alternate;
    filter: blur(2px);
}

@keyframes flameCore {
    0% {
        width: 16px;
        height: 7px;
        opacity: 0.9;
    }
    100% {
        width: 20px;
        height: 9px;
        opacity: 1;
    }
}

@keyframes flameMiddle {
    0% {
        width: 26px;
        height: 11px;
        opacity: 0.7;
    }
    100% {
        width: 30px;
        height: 14px;
        opacity: 0.85;
    }
}

@keyframes flameOuter {
    0% {
        width: 35px;
        height: 14px;
        opacity: 0.4;
    }
    100% {
        width: 42px;
        height: 18px;
        opacity: 0.6;
    }
}

/* Clean login background — floating icons, moon, and ship are hidden for a minimal look */
.login-floating-icons,
.space-moon,
.eff-ship-container {
    display: none !important;
}

/* Floating icons (planets) - DVD bouncing style (currently hidden above) */
.login-floating-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease-out;
}

.login-floating-icons.visible {
    opacity: 1;
}

.floating-icon {
    position: absolute;
    pointer-events: none;
    cursor: default;
    opacity: 0.85;
    z-index: 2;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.floating-icon.bouncing {
    transition: none;
}

.floating-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.floating-icon.eff-avatar {
    background: linear-gradient(135deg, #18A74B 0%, #1E6332 50%, #214A3E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(47, 133, 66, 0.5), 0 0 40px rgba(30, 99, 50, 0.3), inset 0 -3px 10px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.floating-icon.hub-icon {
    background: linear-gradient(135deg, #ffffff 0%, #F4F0E9 50%, #F4F0E9 100%);
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 0 20px rgba(255,255,255,0.4), 0 0 40px rgba(47, 133, 66, 0.2), inset 0 -3px 10px rgba(0,0,0,0.1);
    border: 2px solid rgba(47, 133, 66, 0.4);
}

.floating-icon.hub-icon img {
    border-radius: 50%;
}

.floating-icon.chat-icon {
    background: linear-gradient(135deg, #F4F0E9 0%, #F4F0E9 50%, #E8DFD0 100%);
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 0 20px rgba(47, 133, 66, 0.4), 0 0 40px rgba(30, 99, 50, 0.25), inset 0 -3px 10px rgba(0,0,0,0.1);
    border: 2px solid rgba(47, 133, 66, 0.5);
}

.floating-icon.chat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(47, 133, 66, 0.15), 0 0 60px rgba(30, 99, 50, 0.1), 0 20px 60px rgba(0,0,0,0.3);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(47, 133, 66, 0.1);
    backdrop-filter: blur(10px);
    animation: loginCardAppear 1s ease-out 2.8s both;
}

/* Skip animation on logout return */
.login-card.no-animation {
    animation: none;
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

@keyframes loginCardAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.login-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Demo User Selection */
.demo-users-section {
    margin-top: 0.5rem;
}

.demo-user-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.demo-user-card {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.demo-user-card.admin {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-color: #fecaca;
}

.demo-user-card.admin:hover {
    border-color: #f87171;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2);
    transform: translateX(4px);
}

.demo-user-card.standard {
    background: linear-gradient(135deg, #F4F0E9 0%, #fff 100%);
    border-color: #E8DFD0;
}

.demo-user-card.standard:hover {
    border-color: #18A74B;
    box-shadow: 0 4px 12px rgba(47, 133, 66, 0.2);
    transform: translateX(4px);
}

.demo-user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 0.875rem;
    flex-shrink: 0;
}

.demo-user-avatar.admin {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
}

.demo-user-avatar.standard {
    background: linear-gradient(135deg, #18A74B 0%, #18A74B 100%);
    color: #fff;
}

.demo-user-info {
    flex: 1;
}

.demo-user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.demo-user-email {
    font-size: 0.8rem;
    color: #6b7280;
}

.demo-user-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    margin-top: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-user-badge.admin {
    background: #fef2f2;
    color: #dc2626;
}

.demo-user-badge.standard {
    background: #F4F0E9;
    color: #2F8542;
}

.demo-user-arrow {
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.demo-user-card:hover .demo-user-arrow {
    transform: translateX(4px);
    color: #6b7280;
}
