/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
:root {
    --primary-color: #6e00ff;
    --secondary-color: #ff0000;
    --dark-bg: #0f0f1a;
    --darker-bg: #0a0a12;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --neon-glow: 0 0 10px rgba(110, 0, 255, 0.8), 0 0 20px rgba(110, 0, 255, 0.6), 0 0 30px rgba(110, 0, 255, 0.4);
    --neon-glow-secondary: 0 0 10px rgba(255, 0, 228, 0.8), 0 0 20px rgba(255, 0, 228, 0.6), 0 0 30px rgba(255, 0, 228, 0.4);
}

body {
    background-color: var(--dark-bg);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Estilos del header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--darker-bg);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.neon-border {
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--neon-glow);
}

.logo {
    display: flex;
    flex-direction: column;
}

.pixel-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.glitch {
    position: relative;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 3px;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00e4;
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00f7ff;
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(32px, 9999px, 12px, 0); }
    10% { clip: rect(8px, 9999px, 96px, 0); }
    20% { clip: rect(45px, 9999px, 33px, 0); }
    30% { clip: rect(31px, 9999px, 79px, 0); }
    40% { clip: rect(92px, 9999px, 73px, 0); }
    50% { clip: rect(9px, 9999px, 14px, 0); }
    60% { clip: rect(67px, 9999px, 62px, 0); }
    70% { clip: rect(100px, 9999px, 6px, 0); }
    80% { clip: rect(23px, 9999px, 89px, 0); }
    90% { clip: rect(3px, 9999px, 68px, 0); }
    100% { clip: rect(53px, 9999px, 5px, 0); }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

.social {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.social-icon:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
    text-shadow: var(--neon-glow);
}

/* Hero section */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10rem 5% 5rem;
    min-height: 100vh;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-pixel {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--primary-color);
    transition: all 0.3s;
}

.btn-pixel:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px var(--secondary-color), var(--neon-glow-secondary);
    transform: translateY(-3px);
}

.btn-pixel::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: 0.5s;
}

.btn-pixel:hover::before {
    left: 100%;
}

.pixel-container {
    border: 6px solid var(--primary-color); /* Reducido de 8px */
    box-shadow: var(--neon-glow);
    position: relative;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
    width: 350px; /* Tamaño reducido a la mitad */
    height: 350px; /* Tamaño reducido a la mitad */
    border-radius: 10px; /* Añadido para mejor apariencia */
}

.pixel-img {
    display: block;
    width: 100%; /* Ahora ocupará el 100% del contenedor reducido */
    height: 100%;
    object-fit: cover; /* Para asegurar que la imagen cubra el espacio */
    filter: grayscale(20%) contrast(110%);
    transition: transform 0.5s;
}

.pixel-container:hover .pixel-img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .pixel-container {
        width: 220px;
        height: 220px;
        margin: 0 auto; /* Centrar en móviles */
    }
}

@media (max-width: 480px) {
    .pixel-container {
        width: 100px;
        height: 100px;
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Secciones generales */
.section {
    padding: 6rem 5%;
    min-height: 100vh;
    scroll-margin-top: 80px;
}

.section-title {
    position: relative;
    margin-bottom: 4rem;
    font-size: 3rem;
    text-align: center;
    color: var(--text-color);
}

.section-title-main {
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.section-title-shadow {
    position: absolute;
    top: 0.5rem;
    left: 0;
    width: 100%;
    color: rgba(110, 0, 255, 0.2);
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Actualiza las reglas existentes y añade estas nuevas */
.skill-bar {
    width: 100%;
    height: 12px; /* Aumentamos un poco el grosor */
    background-color: rgba(110, 0, 255, 0.1);
    border-radius: 6px;
    margin-top: 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color), 
        var(--secondary-color));
    border-radius: 6px;
    width: 0;
    position: relative;
    transition: width 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: progress-glow 2s infinite alternate;
}

/* Efecto de brillo pulsante */
@keyframes progress-glow {
    0% {
        box-shadow: 0 0 5px rgba(110, 0, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(110, 0, 255, 0.8), 
                   0 0 30px rgba(255, 0, 228, 0.4);
    }
}

/* Efecto de partículas (puntos brillantes) */
.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent);
    animation: progress-shine 3s infinite;
    border-radius: 6px;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Efecto de carga con porcentaje */
.skill-card {
    position: relative;
}

.skill-percentage {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.5s;
}

.skill-card.active .skill-percentage {
    opacity: 1;
    transform: translateY(0);
}

/* Conocimientos */
.knowledge-tabs {
    margin-top: 3rem;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background-color: transparent;
    color: var(--text-color);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--primary-color);
    transition: all 0.3s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.tab-btn:hover::after {
    width: 100%;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--neon-glow);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
}

.tech-item {
    background-color: var(--darker-bg);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid rgba(110, 0, 255, 0.2);
}

.tech-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), var(--neon-glow);
    border: 1px solid var(--primary-color);
}

.tech-item img {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    filter: grayscale(100%) brightness(0.8);
    transition: filter 0.3s;
}

.tech-item:hover img {
    filter: grayscale(0%) brightness(1);
}

.tech-item span {
    font-weight: 600;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Pasatiempos */
.games-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--neon-glow);
}

.game-card {
    display: none;
    position: relative;
    height: 400px;
    overflow: hidden;
}

.game-card.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.game-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
    transition: filter 0.5s;
}

.game-card:hover .game-cover {
    filter: brightness(0.9);
}

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    transform: translateY(0);
    transition: transform 0.3s;
}

.game-card:hover .game-info {
    transform: translateY(-10px);
}

.game-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.game-info p {
    margin-bottom: 0.5rem;
}

.game-rating {
    color: gold;
    font-size: 1.2rem;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 1rem;
    z-index: 10;
}

.carousel-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: var(--darker-bg);
    padding: 3rem 5%;
    text-align: center;
}

.neon-border-top {
    border-top: 2px solid var(--primary-color);
    box-shadow: var(--neon-glow);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glitch-small {
    position: relative;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 2px;
}

.glitch-small::before, .glitch-small::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

.glitch-small::before {
    left: 1px;
    text-shadow: -1px 0 #ff00e4;
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch-small::after {
    left: -1px;
    text-shadow: -1px 0 #00f7ff;
    animation: glitch-anim 4s infinite linear alternate-reverse;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-copy p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
    }
    
    .hero-content {
        margin-bottom: 3rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 4rem 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero h2 {
        font-size: 1.2rem;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .games-carousel {
        height: 300px;
    }
    
    .game-info h3 {
        font-size: 1.5rem;
    }
}

/* Estilos del Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--darker-bg);
    margin: 5% auto;
    padding: 2rem;
    width: 80%;
    max-width: 700px;
    position: relative;
    border-radius: 10px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.modal-body {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    margin-bottom: 2rem;
}

.modal-image {
    flex: 1;
}

.pixel-container-small {
    border: 4px solid var(--primary-color);
    box-shadow: var(--neon-glow);
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.modal-text {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.detail-item i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.modal-quote {
    font-style: italic;
    padding: 1rem;
    background-color: rgba(110, 0, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 5px 5px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-modal {
    padding: 0.8rem 1.5rem;
}

.btn-close {
    background-color: transparent;
    border: 1px solid var(--primary-color);
}

.btn-close:hover {
    background-color: rgba(255, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .modal-body {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-text {
        width: 100%;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .pixel-container-small {
        width: 120px;
        height: 120px;
    }
}

/* Estilos para la vista previa horizontal de PDF */
.pdf-preview-container {
    margin-top: 1.5rem;
    width: 100%;
}

.pdf-preview-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
    text-align: center;
}

.pdf-horizontal-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.pdf-horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.pdf-horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(110, 0, 255, 0.1);
    border-radius: 10px;
}

.pdf-horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.pdf-horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.pdf-grid {
    display: inline-flex;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    min-width: min-content;
}

.pdf-item {
    background-color: rgba(110, 0, 255, 0.1);
    border: 1px solid rgba(110, 0, 255, 0.3);
    border-radius: 8px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
    flex-shrink: 0;
}

.pdf-item:hover {
    background-color: rgba(110, 0, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.pdf-item.active {
    background-color: rgba(110, 0, 255, 0.3);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(110, 0, 255, 0.5);
}

.pdf-thumbnail {
    width: 200px;
    height: 280px;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 0.8rem;
    background-color: #f5f5f5;
    position: relative;
}

.pdf-thumbnail::before {
    content: "PDF";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 0;
}

.pdf-thumbnail iframe {
    position: relative;
    z-index: 1;
    background-color: white;
}

.pdf-item span {
    font-size: 0.9rem;
    color: var(--text-color);
    text-align: center;
    font-weight: 500;
}

/* Ajustes para el modal con scroll */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    flex-wrap: wrap;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .pdf-thumbnail {
        width: 160px;
        height: 220px;
    }
    
    .pdf-item {
        min-width: 160px;
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    .pdf-thumbnail {
        width: 120px;
        height: 180px;
    }
    
    .pdf-item {
        min-width: 120px;
    }
}