/* Main styles for Planetary World Simulation */

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

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); }
}

@keyframes urgent-pulse {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { transform: translateX(-50%) scale(1.2); box-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
    100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
}

/* Game UI elements */
.planet-label {
    position: absolute;
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 1.0), 0 0 25px rgba(79, 195, 247, 1.0);
    pointer-events: none;
    z-index: 1000;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.distance-indicator {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #4fc3f7;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    z-index: 1000;
    border: 1px solid #4fc3f7;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
    display: none;
}

.distance-indicator-pulse {
    animation: pulse 2s infinite ease-in-out;
    transform-origin: center !important;
}

.distance-indicator-urgent {
    animation: urgent-pulse 1s infinite ease-in-out;
    transform-origin: center !important;
}

/* Hyperspace effect */
#hyperspace-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 0%, rgba(79, 195, 247, 0.8) 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 9000;
    transition: opacity 0.5s;
}

#hyperspace-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9001;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    background: black;
}

#hyperspace-stars:before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 4px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 4px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    animation: hyperspace-stars 1s linear infinite;
}

@keyframes hyperspace-stars {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(5deg) scale(3); }
}

#hyperspace-progress-container {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;
    pointer-events: none;
}

#hyperspace-progress {
    width: 300px;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    border: 1px solid #ffffff;
    overflow: hidden;
}

#hyperspace-progress .bar {
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    transition: width 0.5s;
}

/* Pause Indicator */
.pause-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ff5555;
    font-size: 32px;
    font-family: 'Orbitron', sans-serif;
    border: 2px solid #ff5555;
    border-radius: 10px;
    z-index: 10000;
    animation: pulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 20px rgba(255, 85, 85, 0.5);
}

/* Loading Progress Bar */
.loading-progress-container {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin: 20px auto;
    border: 1px solid #3498db;
    overflow: hidden;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease-in-out;
}

/* Helper classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.fade-in {
    animation: fadeIn 0.5s forwards;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s;
}

/* Global styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: #000;
    color: #fff;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Loading screen styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader {
    border: 8px solid #0f0f0f;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 24px;
    color: #3498db;
    margin-bottom: 10px;
}

/* Game container styles */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* HUD styles */
#hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    font-family: 'Courier New', monospace;
    color: #3498db;
}

#speed-indicator, #coordinates {
    margin-bottom: 5px;
}

#planet-info {
    color: #2ecc71;
}

/* Labels for planets */
.label {
    color: white;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 3px;
    user-select: none;
    pointer-events: none;
    text-align: center;
}

#planet-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
} 