body {
    background-size: 100%;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: black;

    height: 20vh;

    color: white;
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 0;
    overflow: hidden;
}


body::before {
    content: "";
    position: fixed;
    inset: 0;

    backdrop-filter: blur(2px);

    background:
        radial-gradient(circle at center, rgba(0, 0, 40, 0.3), rgba(0, 0, 0, 0.8)),
        rgba(0, 0, 0, 0.4);

    z-index: -1;
}

.solar-system {
    position: absolute;
    bottom: -400px;
    left: 50%;
    transform: translateX(-50%) scale(1.4);

    width: 800px;
    height: 800px;
}

.sun {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #fffd9e 0%, #f39c12 60%, #e67e22 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 60px 20px rgba(243, 156, 18, 0.5);
    z-index: 100;
    pointer-events: auto;
}

.orbit {
    position: absolute;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    pointer-events: auto;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.orbit:hover {
    border-color: rgba(214, 214, 214, 0.5);
}

.planet {
    position: absolute;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.orbit:hover .planet {
    transform: translateX(-50%) scale(1.5);
}

/* La sombra volumétrica de los planetas se simula inyectando un pseudo-elemento (::after) que 
   cubre exactamente el área del planeta, aplicando una sombra interna (inset box-shadow) 
   alineada de forma geométrica opuesta al Sol para dar ilusión de perspectiva 3D realista.
   Es increible todo lo que se puede hacer con css :D */
.planet::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.planet:hover {
    transform: translateX(-50%) scale(1.5);
}

@keyframes rotate-orbit {
    from {
        transform: translate(-50%, -50%) rotate(-92deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(92deg);
    }
}

.mercury-orbit {
    width: 150px;
    height: 150px;
    animation: rotate-orbit 2.4s linear infinite;
    animation-delay: -0.1s;
    z-index: 90;
}

.mercury {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at bottom, #bdc3c7, #2c3e50);
    top: -7px;
}

.mercury::after {
    box-shadow: inset 0px 4px 4px rgba(0, 0, 0, 0.8);
}

.venus-orbit {
    width: 210px;
    height: 210px;
    animation: rotate-orbit 6.2s linear infinite;
    animation-delay: 0s;
    z-index: 80;
}

.venus {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at bottom, #f39c12, #5e3300);
    top: -11px;
}

.venus::after {
    box-shadow: inset 0px 7px 6px rgba(0, 0, 0, 0.8);
}

.earth-orbit {
    width: 290px;
    height: 290px;
    animation: rotate-orbit 10s linear infinite;
    animation-delay: -2s;
    z-index: 70;
}

.earth {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at bottom, #3498db, #0a2e4d);
    top: -12px;
}

.earth::after {
    box-shadow: inset 0px 8px 8px rgba(0, 0, 0, 0.8);
}

.mars-orbit {
    width: 360px;
    height: 360px;
    animation: rotate-orbit 18.8s linear infinite;
    animation-delay: -1s;
    z-index: 60;
}

.mars {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at bottom, #e74c3c, #4d100a);
    top: -10px;
}

.mars::after {
    box-shadow: inset 0px 6px 6px rgba(0, 0, 0, 0.8);
}

.jupiter-orbit {
    width: 480px;
    height: 480px;
    animation: rotate-orbit 118.6s linear infinite;
    animation-delay: 0s;
    z-index: 50;
}

.jupiter {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at bottom, #f1c40f, #4d3d0a);
    top: -25px;
}

.jupiter::after {
    box-shadow: inset 0px 18px 15px rgba(0, 0, 0, 0.9);
}

.saturn-orbit {
    width: 590px;
    height: 590px;
    animation: rotate-orbit 294.6s linear infinite;
    animation-delay: 0s;
    z-index: 40;
}

.saturn {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle at bottom, #d4ac0d, #3b3100);
    top: -22px;
}

.saturn::after {
    box-shadow: inset 0px 15px 12px rgba(0, 0, 0, 0.9);
}

.uranus-orbit {
    width: 680px;
    height: 680px;
    animation: rotate-orbit 840s linear infinite;
    animation-delay: 0s;
    z-index: 30;
}

.uranus {
    width: 34px;
    height: 34px;
    background: radial-gradient(circle at bottom, #aed6f1, #1b4f72);
    top: -17px;
}

.uranus::after {
    box-shadow: inset 0px 12px 10px rgba(0, 0, 0, 0.8);
}

.neptune-orbit {
    width: 760px;
    height: 760px;
    animation: rotate-orbit 1648s linear infinite;
    animation-delay: 0s;
    z-index: 20;
}

.neptune {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at bottom, #5dade2, #151b4d);
    top: -16px;
}

.neptune::after {
    box-shadow: inset 0px 10px 8px rgba(0, 0, 0, 0.8);
}





#close-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    left: auto;
    z-index: 1120;
    width: 35px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    color: transparent;
}

#close-panel::before,
#close-panel::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: white;
    transition: background-color 0.3s ease;
}

#close-panel::before {
    transform: rotate(45deg);
}

#close-panel::after {
    transform: rotate(-45deg);
}

#close-panel:hover {
    transform: scale(1.1) rotate(90deg);
    background-color: rgba(255, 50, 50, 0.6);
    border-color: rgba(255, 100, 100, 0.8);
}

#planet-panel {
    position: fixed;
    top: 50%;
    right: -100%;
    transform: translateY(-50%);
    width: 400px;
    max-width: 90vw;
    height: auto;
    max-height: 85vh;
    padding: 30px;

    /* Patrón Glassmorphism: Fondo oscuro translúcido con efecto de desenfoque aplicado al fondo continuo */
    background: rgba(15, 10, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: -10px 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.05);

    transition: right 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1100;
    overflow-y: auto;
    text-align: left;
}

#planet-panel.open {
    right: 5%;
}

.panel-content h2 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.panel-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.panel-content td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 12px;
    font-size: 0.95rem;
}

.panel-content tr:last-child td {
    border-bottom: none;
}

.panel-content td:first-child {
    font-weight: 500;
    color: #b3b3b3;
    width: 45%;
}

.panel-content td:last-child {
    text-align: right;
    color: #ffffff;
    font-weight: bold;
}

.panel-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cccccc;
    margin-top: 25px;
}

.blur-background {
    filter: blur(100%);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}


#planet-viewer {
    position: fixed;
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    z-index: 1200;
    display: none;
    pointer-events: none;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/*Esta parte tuve que hacerla si o si con IA porque no se me ocurrio como hacerla*/
#planet-sphere {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    animation: rotatePlanet 40s linear infinite;
    box-shadow:
        inset -20px -20px 60px rgba(0, 0, 0, 0.8),
        inset 10px 10px 20px rgba(255, 255, 255, 0.2),
        0 0 50px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

#planet-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    background-image: url('../textures/saturn_ring_2d.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: screen;
    z-index: 3;
    opacity: 0.9;
    pointer-events: none;
}

@keyframes rotatePlanet {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: 1000px;
    }
}

@media (max-width: 900px) {
    #planet-panel {
        right: 0;
        top: auto;
        bottom: -100%;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        transition: bottom 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    #planet-panel.open {
        bottom: 0;
        right: 0;
    }

    #planet-viewer {
        top: 20%;
        left: 50%;
        width: 200px;
        height: 200px;
    }
}

.hover-name {
    position: fixed;
    top: 30px;
    right: 40px;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    background: rgba(15, 10, 20, 0.6);
    padding: 12px 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translateY(-15px);
    z-index: 1000;
    pointer-events: none;
    letter-spacing: 2px;
}

.hover-name.visible {
    opacity: 1;
    transform: translateY(0);
}