/* style.css - Minimal Cosmic Background */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000000;  /* Простой черный фон */
    color: #fff;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
}

/* Pulsing Nebula Background */
.nebula-pulse {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 35%, rgba(138, 43, 226, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 65%, rgba(30, 144, 255, 0.025) 0%, transparent 55%),
        radial-gradient(circle at 45% 75%, rgba(0, 206, 209, 0.02) 0%, transparent 60%);
    animation: nebulaPulse 60s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes nebulaPulse {
    0%, 100% {
        opacity: 0.4;
        filter: hue-rotate(0deg) brightness(0.9);
        transform: scale(1);
    }
    25% {
        opacity: 0.5;
        filter: hue-rotate(10deg) brightness(0.95);
        transform: scale(1.02);
    }
    50% {
        opacity: 0.6;
        filter: hue-rotate(20deg) brightness(1);
        transform: scale(1.05);
    }
    75% {
        opacity: 0.5;
        filter: hue-rotate(10deg) brightness(0.95);
        transform: scale(1.02);
    }
}

/* Color Shift Overlay */
.color-shift {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(138, 43, 226, 0.01) 0%, 
        rgba(30, 144, 255, 0.008) 50%,
        rgba(0, 206, 209, 0.006) 100%);
    animation: colorShift 90s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes colorShift {
    0% { opacity: 0.1; }
    50% { opacity: 0.2; }
    100% { opacity: 0.1; }
}

canvas {
    display: block;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(34, 197, 94, 0.2);
    border-top: 4px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-screen p {
    font-size: 18px;
    color: #22c55e;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Info Panel */
#info-panel {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%) translateX(400px);
    width: 400px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(22, 33, 62, 0.95) 100%) !important;
    backdrop-filter: blur(25px) saturate(180%);
    border: 2px solid rgba(34, 197, 94, 0.6);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 8px 32px rgba(21, 128, 61, 0.6),
        0 0 0 1px rgba(34, 197, 94, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
    overflow-y: auto;
}

#info-panel.visible {
    transform: translateY(-50%) translateX(0) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#info-panel.hidden {
    transform: translateY(-50%) translateX(400px);
    display: none;
}

.panel-content {
    position: relative;
}

.panel-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #22c55e;
    text-align: center;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
    border-bottom: 2px solid rgba(34, 197, 94, 0.3);
    padding-bottom: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#planet-description {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #e0e0e0;
    font-size: 16px;
    text-align: justify;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid rgba(34, 197, 94, 0.5);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    transition: all 0.3s ease;
}

.detail-label {
    font-weight: bold;
    color: #22c55e;
    min-width: 180px;
    text-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
}

.detail-value {
    color: #e0e0e0;
    text-align: right;
    flex: 1;
}

.facts-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.fact-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 25px;
}

.fact-item:before {
    content: "✨";
    color: #22c55e;
    margin-right: 10px;
    font-size: 16px;
    position: absolute;
    left: 0;
    top: 12px;
    filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.5));
}

.panel-btn {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #15803d 100%);
    border: 2px solid rgba(34, 197, 94, 0.4);
    color: #fff;
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 15px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.panel-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.panel-btn:hover:before {
    left: 100%;
}

.audio-btn {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #0f766e 100%);
}

.panel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 5px 15px rgba(34, 197, 94, 0.3),
        0 0 20px rgba(21, 128, 61, 0.4);
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: none;
    color: #22c55e;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.2));
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* FPS Counter */
#fps-counter {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(26, 26, 46, 0.8);
    color: #0f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(34, 197, 94, 0.3);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Enhanced Scrollbar Styling */
#info-panel::-webkit-scrollbar {
    width: 8px;
}

#info-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 5px;
}

#info-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

#info-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.back-btn {
    background: linear-gradient(135deg, #16213e 0%, #1e293b 50%, #16213e 100%);
    margin-top: 10px;
}

.back-btn:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}

/* Responsive */
@media (max-width: 768px) {
    #info-panel {
        width: 90%;
        right: 5%;
        padding: 20px;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-label {
        min-width: auto;
    }
    
    .detail-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    #info-panel {
        width: 95%;
        right: 50%;
        padding: 15px;
    }
    
    .panel-content h2 {
        font-size: 24px;
    }
    
    #planet-description {
        font-size: 14px;
    }
    
    .panel-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Additional utility classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-green {
    color: #22c55e;
    text-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
}

.text-silver {
    color: #e0e0e0;
}

.bg-dark {
    background: rgba(26, 26, 46, 0.9);
}

/* Enhanced Animation for panel appearance */
@keyframes slideInFromRight {
    0% {
        transform: translateY(-50%) translateX(400px);
        opacity: 0;
    }
    100% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

#info-panel.visible {
    animation: slideInFromRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Enhanced Hover effects */
.panel-btn:active {
    transform: translateY(0);
}

.fact-item:hover {
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    padding-left: 30px;
    padding-right: 10px;
    transform: translateX(5px);
}

.detail-item:hover {
    background: rgba(34, 197, 94, 0.05);
    border-radius: 8px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom-color: rgba(34, 197, 94, 0.4);
}

/* Enhanced Focus states */
.panel-btn:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.close-btn:focus {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Enhanced Selection styles */
::selection {
    background: rgba(34, 197, 94, 0.3);
    color: white;
    text-shadow: none;
}

::-moz-selection {
    background: rgba(34, 197, 94, 0.3);
    color: white;
    text-shadow: none;
}