* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    overflow: hidden;
    font-family: 'Fira Code', monospace;
    background: radial-gradient(ellipse at bottom, #1a3857 0%, #1b1b1b 100%);
    color: #fff;
    height: 100vh;
    transition: transform 1s ease, filter 1s ease;
}

h1,
h2,
h3,
p,
.label {
    font-family: 'Fira Code', monospace;
}

.language-selector {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
}

.language-selector button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff99;
    color: #00ff99;
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    transition: all 0.2s;
}

.language-selector button.active {
    background: #00ff99;
    color: #0d1b2a;
    box-shadow: 0 0 10px #00ff99;
    font-weight: bold;
}

.language-selector button:hover:not(.active) {
    background: rgba(0, 255, 153, 0.2);
}

.terminal-name {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
    color: #00ff99;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 5px #00ff99;
    white-space: nowrap;
    line-height: 1.4;
}

.terminal-name span {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00ff99;
    width: 0;
}

.terminal-name .line-1 {
    animation: typing-l1 3s steps(17, end) forwards,
        hide-cursor 0.01s forwards 3.01s;
}

.terminal-name .line-2 {
    font-size: 0.8em;
    font-weight: 400;
    animation: typing-l2 3s steps(18, end) forwards 3.5s,
        hide-cursor 0.01s forwards 6.5s,
        blink-caret 0.75s step-end infinite 6.5s;
}

@keyframes typing-l1 {
    from {
        width: 0
    }

    to {
        width: 23ch
    }
}

@keyframes typing-l2 {
    from {
        width: 0
    }

    to {
        width: 25ch
    }
}

@keyframes hide-cursor {
    to {
        border-right: none;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #00ff99;
    }
}

.stars {
    width: 100%;
    height: 100%;
    background: transparent url('../assets/images/stardust.png') repeat;
    animation: moveStars 200s linear infinite;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    transition: transform 1s ease;
}

@keyframes moveStars {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -10000px 10000px;
    }
}

.galaxy {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 1s ease;
}

body.zoomed .stars,
body.zoomed .galaxy {
    transform: scale(0.98);
    filter: brightness(0.7) blur(1px);
}

.star {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: starTwinkle 8s ease-in-out infinite;
}

.star[data-section="perfil"] {
    background: radial-gradient(circle, #fff 0%, #00e1ff 60%, transparent 100%);
    box-shadow: 0 0 15px #00e1ff;
    animation-delay: 0.8s;
}

.star[data-section="experiencia"] {
    background: radial-gradient(circle, #fff 0%, #b347ff 60%, transparent 100%);
    box-shadow: 0 0 15px #b347ff;
    animation-delay: 2.4s;
}

.star[data-section="skills"] {
    background: radial-gradient(circle, #fff 0%, #00ff99 60%, transparent 100%);
    box-shadow: 0 0 15px #00ff99;
    animation-delay: 4.2s;
}

.star[data-section="contacto"] {
    background: radial-gradient(circle, #fff 0%, #ffe066 60%, transparent 100%);
    box-shadow: 0 0 15px #ffe066;
    animation-delay: 6.1s;
}

.star[data-star-id] {
    background: radial-gradient(circle, #fff 0%, #ff8c00 60%, transparent 100%) !important;
    box-shadow: 0 0 10px #ff8c00 !important;
}

.star:hover {
    transform: scale(1.3);
    box-shadow: 0 0 20px currentColor, 0 0 50px currentColor;
}

/* Delays adicionales para crear variación en el titileo */
.star.twinkle-delay-1 { animation-delay: 0.3s; }
.star.twinkle-delay-2 { animation-delay: 1.1s; }
.star.twinkle-delay-3 { animation-delay: 1.7s; }
.star.twinkle-delay-4 { animation-delay: 2.9s; }
.star.twinkle-delay-5 { animation-delay: 3.6s; }
.star.twinkle-delay-6 { animation-delay: 4.8s; }
.star.twinkle-delay-7 { animation-delay: 5.4s; }
.star.twinkle-delay-8 { animation-delay: 6.7s; }
.star.twinkle-delay-9 { animation-delay: 7.3s; }
.star.twinkle-delay-10 { animation-delay: 0.9s; }
.star.twinkle-delay-11 { animation-delay: 2.1s; }
.star.twinkle-delay-12 { animation-delay: 3.3s; }
.star.twinkle-delay-13 { animation-delay: 4.5s; }
.star.twinkle-delay-14 { animation-delay: 5.7s; }
.star.twinkle-delay-15 { animation-delay: 7.1s; }

.label {
    position: absolute;
    color: currentColor;
    text-shadow: 0 0 10px currentColor;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    font-weight: bold;
    animation: floatLabel 3s ease-in-out infinite alternate;
}

@keyframes floatLabel {
    0% {
        transform: translateY(0px);
        opacity: 0.9;
    }

    25% {
        transform: translateY(-4px);
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }

    75% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0px);
        opacity: 0.9;
    }
}

.star.active {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }

    50% {
        transform: scale(1.3);
        filter: brightness(1.6);
    }

    100% {
        transform: scale(1.1);
        filter: brightness(1.2);
    }
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    opacity: 0.9;
    pointer-events: none;
    animation: sparkMove 0.8s ease-out forwards;
}

@keyframes sparkMove {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: scale(0.2) translate(var(--x), var(--y));
        opacity: 0;
    }
}

@keyframes starTwinkle {
    0%, 90%, 100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: inherit;
    }

    5%, 15% {
        transform: scale(1.2);
        filter: brightness(1.5);
        box-shadow: 0 0 25px currentColor, 0 0 40px currentColor;
    }

    10% {
        transform: scale(1.4);
        filter: brightness(2);
        box-shadow: 0 0 35px currentColor, 0 0 60px currentColor;
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 10, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2;
}

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

.info-panel {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 90%;
    max-width: 700px;
    max-height: 80%;
    background: rgba(13, 27, 42, 0.95);
    border: 1px solid #00e1ff;
    border-radius: 12px;
    padding: 30px;
    text-align: left;
    box-shadow: 0 0 30px #00e1ff44;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    line-height: 1.6;
    z-index: 3;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00ffff #0d1b2a;
}

.info-panel::-webkit-scrollbar {
    width: 6px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 6px;
}

.info-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    color: #00e1ff;
    cursor: pointer;
    font-size: 22px;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    color: #fff;
    transform: scale(1.2);
}

h2 {
    text-align: center;
    color: #00ffff;
    margin-bottom: 15px;
}

h3 {
    color: #00e1ff;
    margin-top: 18px;
    margin-bottom: 6px;
}

p {
    margin-bottom: 12px;
}

a {
    color: #00ffff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

svg.constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .language-selector {
        bottom: 20px;
        right: 20px;
    }

    .terminal-name {
        top: 20px;
        left: 20px;
        font-size: 1.1em;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .container {
        height: 100vh;
    }

    .language-selector {
        bottom: 15px;
        right: 15px;
    }

    .language-selector button {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .terminal-name {
        top: 15px;
        left: 15px;
        font-size: 1em;
    }

    .info-panel {
        width: 95%;
        padding: 20px;
        bottom: 70px; /* Espacio para el selector de idiomas */
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .language-selector {
        bottom: 10px;
        right: 10px;
    }

    .language-selector button {
        padding: 6px 10px;
        font-size: 0.8em;
        margin-left: 3px;
    }

    .terminal-name {
        top: 10px;
        left: 10px;
        font-size: 0.9em;
    }

    .info-panel {
        bottom: 60px;
        padding: 15px;
    }
}
