/* Space Theme Enhancements */

/* Animated background particles */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 1; }
}

@keyframes orbit {
    0% { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

/* Space particles background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #64ffda, transparent),
        radial-gradient(2px 2px at 40px 70px, #667eea, transparent),
        radial-gradient(1px 1px at 90px 40px, #f093fb, transparent),
        radial-gradient(1px 1px at 130px 80px, #64ffda, transparent),
        radial-gradient(2px 2px at 160px 30px, #667eea, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
    z-index: -2;
    pointer-events: none;
}

/* Nebula effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, rgba(100, 255, 218, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at left, rgba(240, 147, 251, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Enhanced glow effects */
.glow {
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
    animation: pulse 2s ease-in-out infinite alternate;
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.5);
    transition: box-shadow 0.3s ease;
}

/* Space-themed scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 15, 28, 0.8);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #64ffda, #667eea);
    border-radius: 6px;
    border: 2px solid rgba(10, 15, 28, 0.8);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4fd3b8, #5a6fd8);
}

/* Firefox scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #64ffda rgba(10, 15, 28, 0.8);
}

/* Enhanced button animations */
.btn-space {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(100, 255, 218, 0.3);
}

.btn-space::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn-space:hover::before {
    left: 100%;
}

.btn-space::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.6) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn-space:hover::after {
    width: 120%;
    height: 120%;
}

/* Floating elements */
.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element:nth-child(2n) {
    animation-delay: -2s;
    animation-direction: reverse;
}

.float-element:nth-child(3n) {
    animation-delay: -4s;
}

/* Planet-like decorative elements */
.planet {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(100, 255, 218, 0.6), rgba(102, 126, 234, 0.3));
    animation: orbit 20s linear infinite;
}

.planet-small {
    width: 20px;
    height: 20px;
    top: 10%;
    right: 15%;
}

.planet-medium {
    width: 40px;
    height: 40px;
    top: 60%;
    left: 5%;
    animation-duration: 30s;
    animation-direction: reverse;
}

.planet-large {
    width: 60px;
    height: 60px;
    top: 20%;
    left: 80%;
    animation-duration: 45s;
}

/* Space-themed card enhancements */
.space-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.space-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #64ffda, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.space-card:hover::before {
    opacity: 1;
}

.space-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.space-card:hover::after {
    opacity: 1;
}

/* Holographic text effect */
.holographic {
    background: linear-gradient(45deg, #64ffda, #667eea, #f093fb, #64ffda);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: hologram 3s ease-in-out infinite;
}

@keyframes hologram {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Space grid pattern */
.space-grid {
    background-image: 
        linear-gradient(rgba(100, 255, 218, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 255, 218, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    position: relative;
}

.space-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(10, 15, 28, 0.8) 100%);
    pointer-events: none;
}

/* Enhanced loading animations */
.loading-space {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(100, 255, 218, 0.3);
    border-radius: 50%;
    border-top-color: #64ffda;
    animation: spin 1s ease-in-out infinite;
    position: relative;
}

.loading-space::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #64ffda;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1s ease-in-out infinite;
}

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

/* Cosmic dust effect */
.cosmic-dust {
    position: relative;
    overflow: hidden;
}

.cosmic-dust::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(1px 1px at 10px 10px, rgba(100, 255, 218, 0.3), transparent),
        radial-gradient(1px 1px at 30px 50px, rgba(102, 126, 234, 0.3), transparent),
        radial-gradient(1px 1px at 70px 20px, rgba(240, 147, 251, 0.3), transparent);
    background-size: 100px 100px;
    animation: drift 10s linear infinite;
    pointer-events: none;
}

@keyframes drift {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* Space-themed form inputs */
.space-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    color: #ffffff;
    padding: 12px 15px;
    transition: all 0.3s ease;
    position: relative;
}

.space-input:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 
        0 0 0 3px rgba(100, 255, 218, 0.1),
        inset 0 1px 10px rgba(100, 255, 218, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.space-input::placeholder {
    color: rgba(184, 198, 219, 0.6);
}

/* Aurora effect */
.aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(100, 255, 218, 0.1) 25%,
        rgba(102, 126, 234, 0.1) 50%,
        rgba(240, 147, 251, 0.1) 75%,
        transparent 100%
    );
    animation: aurora 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes aurora {
    0% { transform: translateX(-100%) skewX(-15deg); }
    100% { transform: translateX(100%) skewX(15deg); }
}

/* Constellation connections */
.constellation {
    position: relative;
}

.constellation::before,
.constellation::after {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(rgba(100, 255, 218, 0.6), transparent);
    animation: pulse 2s ease-in-out infinite alternate;
}

.constellation::before {
    height: 50px;
    top: -25px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.constellation::after {
    height: 50px;
    bottom: -25px;
    right: 50%;
    transform: translateX(50%) rotate(-45deg);
    animation-delay: 1s;
}

/* Responsive space effects */
@media (max-width: 768px) {
    body::before {
        background-size: 100px 50px;
    }
    
    .planet {
        display: none;
    }
    
    .cosmic-dust::before {
        background-size: 50px 50px;
    }
    
    .space-grid {
        background-size: 25px 25px;
    }
}

@media (max-width: 480px) {
    body::before {
        animation: none;
        opacity: 0.3;
    }
    
    .aurora {
        display: none;
    }
    
    .float-element {
        animation: none;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before,
    body::after {
        animation: none;
    }
    
    .planet,
    .float-element,
    .aurora,
    .cosmic-dust::before {
        animation: none;
    }
}

/* Dark theme enhancements */
.dark-mode {
    --primary-bg: #0a0f1c;
    --secondary-bg: #1a2035;
    --accent-color: #64ffda;
    --text-primary: #ffffff;
    --text-secondary: #b8c6db;
    --border-color: rgba(100, 255, 218, 0.1);
}

/* Space-themed selection styles */
::selection {
    background: rgba(100, 255, 218, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(100, 255, 218, 0.3);
    color: #ffffff;
}

/* Enhanced focus styles for accessibility */
.space-focus:focus {
    outline: 2px solid #64ffda;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Space-themed tooltips */
.space-tooltip {
    position: relative;
    cursor: help;
}

.space-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 15, 28, 0.95);
    color: #64ffda;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 255, 218, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.space-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}
