:root {
    --space-dark: #0b0d17;
    --space-light: #d0d6f9;
    --space-white: #ffffff;
    --sun-color: #fdb813;
    --mercury-color: #a9a9a9;
    --venus-color: #e6c229;
    --earth-color: #6b93d6;
    --mars-color: #e27b58;
    --jupiter-color: #c88b3a;
    --saturn-color: #e4d191;
    --uranus-color: #d1e7e7;
    --neptune-color: #5b5ddf;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--space-dark);
    color: var(--space-white);
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at center, rgba(255,255,255,0.05) 1px, transparent 1px),
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px, 150px 150px;
}

header {
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--space-white), var(--space-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(208, 214, 249, 0.3);
}

.subtitle {
    color: var(--space-light);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.solar-system {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
}

.sun {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at center, var(--sun-color), #f58220);
    border-radius: 50%;
    box-shadow: 0 0 50px var(--sun-color), 0 0 100px rgba(253, 184, 19, 0.5);
    z-index: 1;
    animation: pulse 4s infinite alternate;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.sun:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px var(--sun-color), 0 0 120px rgba(253, 184, 19, 0.7);
}
.orbit {
    position: absolute;
    border: 1px solid rgba(208, 214, 249, 0.1);
    border-radius: 50%;
    animation: rotateOrbit linear infinite;
    pointer-events: none;
}

.planet {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
}

.planet:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Planet specific styles */
.mercury { background-color: var(--mercury-color); z-index: 10; }
.venus { background-color: var(--venus-color); z-index: 20;}
.earth { background-color: var(--earth-color); background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/1200px-The_Earth_seen_from_Apollo_17.jpg'); background-size: cover; }
.mars { background-color: var(--mars-color); }
.jupiter { background-color: var(--jupiter-color); background-image: url('https://upload.wikimedia.org/wikipedia/commons/2/2b/Jupiter_and_its_shrunken_Great_Red_Spot.jpg'); background-size: cover; }
.saturn { background-color: var(--saturn-color); position: relative; }
.uranus { background-color: var(--uranus-color); }
.neptune { background-color: var(--neptune-color); }

/* Saturn rings */
.saturn::before {
    content: '';
    position: absolute;
    width: 180%;
    height: 20%;
    background: rgba(228, 209, 145, 0.5);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(20deg);
    z-index: -1;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--space-dark);
    border: 1px solid var(--space-light);
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    padding: 2rem;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s;
    box-shadow: 0 0 20px rgba(208, 214, 249, 0.2);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 2rem;
    color: var(--space-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.planet-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
}

.close-btn {
    background: none;
    border: none;
    color: var(--space-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--space-white);
}

.modal-body {
    color: var(--space-light);
    line-height: 1.6;
}

.planet-facts {
    margin-top: 1rem;
}

.fact-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(208, 214, 249, 0.2);
}

.fact-title {
    font-weight: bold;
    color: var(--space-white);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.control-btn {
    background: rgba(208, 214, 249, 0.1);
    border: 1px solid var(--space-light);
    color: var(--space-light);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background: rgba(208, 214, 249, 0.2);
    color: var(--space-white);
}

.search-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10;
}

.search-input {
    background: rgba(208, 214, 249, 0.1);
    border: 1px solid var(--space-light);
    color: var(--space-white);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    width: 250px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--space-white);
    box-shadow: 0 0 10px rgba(208, 214, 249, 0.3);
}

.highlight {
    animation: highlight 1.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes rotateOrbit {
    0% { transform: rotateZ(0deg); }
    100% { transform: rotateZ(360deg); }
}

@keyframes highlight {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .solar-system {
        transform: scale(0.7);
    }
    
    .search-container {
        top: 1rem;
        right: 1rem;
    }
    
    .search-input {
        width: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}