* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    position: relative;
    height: 100vh;
    cursor: none;
}

/* Canvas de partículas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Video de fondo */
.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
}

/* Cursor personalizado */
#custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff0000, #5a0000);
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    animation: demonic-pulse 1.6s infinite ease-in-out;
}

@keyframes demonic-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px 3px rgba(255, 0, 0, 0.4);
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        box-shadow: 0 0 20px 6px rgba(255, 0, 0, 0.7);
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.touch-device #custom-cursor {
    display: none;
}

.touch-device,
.touch-device * {
    cursor: auto !important;
}

/* Botón Toggle del Reproductor */
.music-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(139, 0, 0, 0.85);
    border: 2px solid rgba(139, 0, 0, 0.6);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
    opacity: 1;
    pointer-events: all;
}

.music-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.music-toggle-btn:hover {
    background: rgba(139, 0, 0, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(139, 0, 0, 0.7);
}

.music-toggle-btn:active {
    transform: scale(0.95);
}

/* Reproductor de música Avanzado */
.music-player-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 300px;
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    border: 1px solid rgba(139, 0, 0, 0.4);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.music-player-container.hidden {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

/* Botón cerrar reproductor */
.close-music-player {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.8rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.close-music-player:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff0000;
    transform: rotate(90deg);
}

.mini-player {
    padding: 15px;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-art-mini {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8B0000;
    flex-shrink: 0;
}

.track-art-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-art {
    font-size: 1.5rem;
}

.track-details {
    flex-grow: 1;
    overflow: hidden;
}

.track-details span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#track-name {
    font-weight: bold;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

#track-artist {
    color: #aaa;
    font-size: 0.8rem;
}

.mini-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.control-btn {
    background: none;
    border: none;
    color: #ddd;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
}

.play-btn {
    font-size: 1.5rem;
    background: rgba(139, 0, 0, 0.6);
    border: 1px solid #8B0000;
    width: 40px;
    height: 40px;
}

.play-btn:hover {
    background: rgba(139, 0, 0, 0.9);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

/* Panel Expandido */
.player-expanded {
    padding: 0 15px 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-container {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: #8B0000;
    border-radius: 5px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .progress-bar::after {
    opacity: 1;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #aaa;
}

.volume-container-advanced {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.vol-icon {
    font-size: 0.9rem;
}

.volume-slider-advanced {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider-advanced::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider-advanced::-webkit-slider-thumb:hover {
    background: #fff;
}

/* Playlist Panel */
.playlist-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, margin-top 0.4s ease;
    opacity: 0;
    padding: 0 15px;
}

.playlist-panel.active {
    max-height: 300px;
    margin-top: 15px;
    padding-bottom: 15px;
    opacity: 1;
    overflow-y: auto;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-header h3 {
    font-size: 0.9rem;
    color: #ff5555;
    text-transform: uppercase;
}

.close-playlist {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
}

.close-playlist:hover {
    color: #fff;
}

.playlist-items {
    list-style: none;
    padding: 0;
}

.playlist-item {
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    margin-bottom: 5px;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-item.active {
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
}

.playlist-item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.item-title {
    font-size: 0.85rem;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-artist {
    font-size: 0.7rem;
    color: #aaa;
}

.playing-indicator {
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 5px #ff0000;
    display: none;
}

.playlist-item.active .playing-indicator {
    display: block;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.8);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.7;
    }
}

/* Scrollbar para playlist */
.playlist-panel::-webkit-scrollbar {
    width: 5px;
}

.playlist-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.playlist-panel::-webkit-scrollbar-thumb {
    background: rgba(139, 0, 0, 0.5);
    border-radius: 3px;
}

/* Contenedor principal - SIEMPRE FIJO EN EL CENTRO */
.main-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Perfil central - SIEMPRE VISIBLE Y FIJO */
.central-profile {
    text-align: center;
    position: relative;
    z-index: 101;
}

.profile-circle {
    position: relative;
    display: inline-block;
}

.central-profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid #8B0000;
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.8), 0 0 60px rgba(139, 0, 0, 0.4);
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    cursor: pointer;
}

.central-profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(139, 0, 0, 1), 0 0 100px rgba(139, 0, 0, 0.6);
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid rgba(139, 0, 0, 0.6);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
    pointer-events: none;
}

.pulse-ring-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid rgba(139, 0, 0, 0.4);
    border-radius: 50%;
    animation: pulse-ring 2s infinite 1s;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.central-name {
    font-size: 3rem;
    margin: 1.5rem 0 0.5rem;
    color: #8B0000;
    text-transform: uppercase;
    animation: glow-red 3.5s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
}

@keyframes glow-red {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(102, 4, 4, 0.6), 0 0 10px rgba(126, 4, 4, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(170, 0, 0, 0.6), 0 0 30px rgba(129, 0, 0, 0.8);
    }
}

.central-quote {
    font-style: italic;
    color: #ccc;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Botones del menú - ALREDEDOR DE LA IMAGEN */
.menu-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.menu-nav-button {
    position: absolute;
    background: rgba(139, 0, 0, 0.85);
    border: 3px solid #8B0000;
    border-radius: 50%;
    color: #fff;
    width: 90px;
    height: 90px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.6);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.menu-nav-button.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.menu-nav-button:hover {
    background: rgba(139, 0, 0, 1);
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(139, 0, 0, 0.8), 0 0 40px rgba(139, 0, 0, 0.5);
}

.button-icon {
    font-size: 2rem;
    line-height: 1;
}

.button-label {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Posiciones de los botones - ALREDEDOR DEL CÍRCULO */
.menu-nav-button:nth-child(1) {
    top: -140px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    transition-delay: 0.1s;
}

.menu-nav-button:nth-child(1).active {
    transform: translateX(-50%) scale(1);
}

.menu-nav-button:nth-child(1):hover {
    transform: translateX(-50%) scale(1.15);
}

.menu-nav-button:nth-child(2) {
    top: 50%;
    left: -100px;
    transform: translateY(-50%) scale(0);
    transition-delay: 0.2s;
}

.menu-nav-button:nth-child(2).active {
    transform: translateY(-50%) scale(1);
}

.menu-nav-button:nth-child(2):hover {
    transform: translateY(-50%) scale(1.15);
}

.menu-nav-button:nth-child(3) {
    top: 50%;
    right: -100px;
    transform: translateY(-50%) scale(0);
    transition-delay: 0.3s;
}

.menu-nav-button:nth-child(3).active {
    transform: translateY(-50%) scale(1);
}

.menu-nav-button:nth-child(3):hover {
    transform: translateY(-50%) scale(1.15);
}

/* Overlay de secciones - MENOS OPACO PARA VER EL VIDEO */
.section-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(10px);
}

.section-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.section-content {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: rgba(20, 20, 40, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(139, 0, 0, 0.5);
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.section-overlay.active .section-content {
    transform: translateY(0);
}

.close-section {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #8B0000;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 301;
    line-height: 1;
}

.close-section:hover {
    transform: rotate(90deg);
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.section-content h2 {
    color: #ff3333;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    text-align: center;
    border-bottom: 2px solid rgba(139, 0, 0, 0.3);
    padding-bottom: 1rem;
}

/* Biografía */
.bio-content {
    line-height: 1.8;
    color: #ddd;
}

.bio-content p {
    margin-bottom: 1rem;
}

.bio-content strong {
    color: #ff9999;
}

.bio-quote {
    font-style: italic;
    color: #ff6666;
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    border-top: 1px solid rgba(255, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 0, 0, 0.3);
    font-size: 1.1rem;
}

.bio-content ul {
    padding-left: 2rem;
    margin: 1rem 0;
    list-style: none;
}

.bio-content ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.bio-content ul li::before {
    content: '➤';
    color: #8B0000;
    position: absolute;
    left: -1.5rem;
}

/* Proyectos */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(139, 0, 0, 0.3);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
    border-color: rgba(139, 0, 0, 0.6);
}

.project-card h3 {
    color: #ff5555;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

.project-card p {
    font-size: 0.95rem;
    color: #ddd;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(139, 0, 0, 0.4);
    border-radius: 15px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border: 1px solid #8B0000;
}

.project-link {
    display: inline-block;
    color: #ff6666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    font-weight: bold;
}

.project-link:hover {
    color: #ff9999;
    text-decoration: underline;
}

/* Redes sociales */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(139, 0, 0, 0.3);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
    border-color: rgba(139, 0, 0, 0.6);
    background: rgba(139, 0, 0, 0.2);
}

.social-link span:first-child {
    font-size: 2.5rem;
}

.social-link span:last-child {
    font-size: 1rem;
    font-weight: bold;
}

/* Clase helper */
.hidden {
    display: none;
}

/* Scrollbar personalizado */
.section-content::-webkit-scrollbar {
    width: 8px;
}

.section-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.section-content::-webkit-scrollbar-thumb {
    background: rgba(139, 0, 0, 0.5);
    border-radius: 4px;
}

.section-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 0, 0, 0.7);
}

/* ==========================================
   RESPONSIVE DESIGN - TABLETS Y MÓVILES
   ========================================== */

/* Tablets (768px y menos) */
@media screen and (max-width: 768px) {

    /* Foto de perfil más pequeña */
    .central-profile-img {
        width: 160px;
        height: 160px;
        border: 4px solid #8B0000;
    }

    .pulse-ring,
    .pulse-ring-2 {
        width: 160px;
        height: 160px;
        border: 2px solid rgba(139, 0, 0, 0.6);
    }

    /* Nombre más pequeño */
    .central-name {
        font-size: 2.3rem;
        margin: 1.2rem 0 0.4rem;
    }

    /* Título más pequeño */
    .central-quote {
        font-size: 1rem;
    }

    /* Botones del menú más pequeños */
    .menu-nav-button {
        width: 75px;
        height: 75px;
        border: 2px solid #8B0000;
    }

    .button-icon {
        font-size: 1.6rem;
    }

    .button-label {
        font-size: 0.7rem;
    }

    /* Ajustar posiciones de los botones */
    .menu-nav-button:nth-child(1) {
        top: -110px;
    }

    .menu-nav-button:nth-child(2) {
        left: -85px;
    }

    .menu-nav-button:nth-child(3) {
        right: -85px;
    }
}

/* Móviles (480px y menos) */
@media screen and (max-width: 480px) {

    /* Foto de perfil más pequeña */
    .central-profile-img {
        width: 120px;
        height: 120px;
        border: 3px solid #8B0000;
    }

    .pulse-ring,
    .pulse-ring-2 {
        width: 120px;
        height: 120px;
        border: 2px solid rgba(139, 0, 0, 0.6);
    }

    /* Nombre más pequeño */
    .central-name {
        font-size: 1.8rem;
        margin: 1rem 0 0.3rem;
    }

    /* Título más pequeño */
    .central-quote {
        font-size: 0.85rem;
    }

    /* Botones del menú más pequeños */
    .menu-nav-button {
        width: 60px;
        height: 60px;
        border: 2px solid #8B0000;
        gap: 0.2rem;
    }

    .button-icon {
        font-size: 1.3rem;
    }

    .button-label {
        font-size: 0.6rem;
    }

    /* Ajustar posiciones de los botones para móviles */
    .menu-nav-button:nth-child(1) {
        top: -80px;
    }

    .menu-nav-button:nth-child(2) {
        left: -65px;
    }

    .menu-nav-button:nth-child(3) {
        right: -65px;
    }

    /* Reproductor de música más pequeño */
    .music-player-container {
        width: 260px;
        top: 10px;
        left: 10px;
    }

    .music-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        top: 10px;
        left: 10px;
    }

    .mini-player {
        padding: 12px;
    }

    .track-art-mini {
        width: 45px;
        height: 45px;
    }

    .default-art {
        font-size: 1.3rem;
    }

    #track-name {
        font-size: 0.9rem;
    }

    #track-artist {
        font-size: 0.75rem;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .play-btn {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    /* Overlay de secciones */
    .section-content {
        width: 95%;
        padding: 1.8rem;
    }

    .section-content h2 {
        font-size: 1.9rem;
    }

    .close-section {
        font-size: 2.5rem;
        top: 10px;
        right: 15px;
    }
}