/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        scroll-behavior: auto !important;
    }
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d1b4e 100%);
    background-attachment: fixed;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    padding-top: 100px;
    position: relative;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.95), rgba(26, 15, 53, 0.95));
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(181, 101, 200, 0.3);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b565c8;
    background: linear-gradient(135deg, #b565c8 0%, #a855b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-link {
    color: #e0e0e0;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #b565c8 0%, #a855b8 100%);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.navbar-link:hover,
.navbar-link.active {
    color: #b565c8;
}

.navbar-link:hover::after,
.navbar-link.active::after {
    width: 80%;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: #b565c8;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 80px;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: linear-gradient(145deg, rgba(45, 27, 78, 0.98), rgba(26, 15, 53, 0.98));
        backdrop-filter: blur(15px);
        padding: 2rem;
        gap: 1rem;
        transition: left 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .navbar-menu.active {
        left: 0;
    }
    
    .navbar-link {
        padding: 1rem;
    }
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 50%, rgba(181, 101, 200, 0.08) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(168, 85, 184, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.parent {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(6, auto);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Tarjetas base */
.card {
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.9), rgba(26, 15, 53, 0.9));
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(181, 101, 200, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(181, 101, 200, 0.3);
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .card {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
    }
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(181, 101, 200, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(181, 101, 200, 0.6);
}

.card h2 {
    color: #d4a5e0;
    margin-bottom: 25px;
    font-size: 1.9em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 15px;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #b565c8, transparent);
    border-radius: 2px;
}

.card h2 i {
    color: #b565c8;
    filter: drop-shadow(0 0 10px rgba(181, 101, 200, 0.5));
}

.card p {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 15px;
}
    
/* Cuadro 1: Información rápida */
.div1 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    background: linear-gradient(145deg, #3730a3, #1e1b4b);
}

.profile-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 4px solid rgba(181, 101, 200, 0.4);
    box-shadow: 0 0 30px rgba(181, 101, 200, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(181, 101, 200, 0.6),
                inset 0 0 20px rgba(255, 255, 255, 0.15);
}

.profile-section h2 {
    color: #e9d5ff;
    margin: 0;
    font-size: 1.8em;
}

.profile-section .title {
    color: #d4a5e0;
    font-size: 1.1em;
    margin: 0;
}

.info-quick {
    width: 100%;
    margin-top: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    padding: 10px;
    background: rgba(181, 101, 200, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(181, 101, 200, 0.15);
    transform: translateX(5px);
}

.info-item i {
    color: #b565c8;
    font-size: 1.2em;
    min-width: 20px;
}

.info-item span {
    color: #d1d5db;
    font-size: 0.9em;
}

.info-item a {
    text-decoration: none;
    color: inherit;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #b565c8, #a855b8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3em;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    background: linear-gradient(135deg, #c084d4, #b565c8);
    transform: scale(1.1) rotate(5deg);
}

/* CV Download Button */
.cv-download {
    width: 100%;
    margin-top: 20px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #b565c8, #a855b8);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(181, 101, 200, 0.3);
    box-shadow: 0 4px 15px rgba(181, 101, 200, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-download::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: left 0.5s;
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover {
    background: linear-gradient(135deg, #c084d4, #b565c8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(181, 101, 200, 0.5);
    border-color: rgba(181, 101, 200, 0.6);
}

.btn-download i {
    font-size: 1.1em;
}

/* Cuadro 2: Sobre mí */
.div2 {
    grid-column: span 3 / span 3;
    grid-row: span 2 / span 2;
    grid-column-start: 3;
}

.div2 p {
    text-align: justify;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skill-tag {
    background: linear-gradient(135deg, #b565c8, #a855b8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(181, 101, 200, 0.3);
    box-shadow: 0 2px 8px rgba(181, 101, 200, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .skill-tag {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: pointer;
    }
    
    .skill-tag:hover {
        background: linear-gradient(135deg, #c084d4, #b565c8);
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 6px 16px rgba(181, 101, 200, 0.5);
        border-color: rgba(181, 101, 200, 0.6);
    }
}

/* Cuadro 3: Proyectos */
.div3 {
    grid-column: span 5 / span 5;
    grid-row: span 2 / span 2;
    grid-row-start: 3;
}

/* Cuadro 4: Educación */
.div4 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-row-start: 5;
}

.education-section {
    margin-top: 20px;
}

.education-item {
    background: rgba(181, 101, 200, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(181, 101, 200, 0.3);
    transition: all 0.3s ease;
}

.education-item:hover {
    background: rgba(181, 101, 200, 0.2);
    border-color: rgba(181, 101, 200, 0.6);
    transform: translateY(-3px);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.education-item h3 {
    color: #d4a5e0;
    font-size: 1.2em;
    margin: 0;
}

.education-date {
    color: #b565c8;
    font-size: 0.9em;
    font-weight: 500;
}

.education-item .institution {
    color: #e9d5ff;
    font-size: 1em;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.education-item .location {
    color: #d4a5e0;
    font-size: 0.9em;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.education-item .description {
    color: #d1d5db;
    font-size: 0.95em;
    margin-top: 12px;
    line-height: 1.6;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.project-item {
    background: rgba(181, 101, 200, 0.1);
    backdrop-filter: blur(5px);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(181, 101, 200, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #b565c8, #a855b8);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-item:hover::before {
    transform: scaleX(1);
}

.project-item:hover {
    background: rgba(181, 101, 200, 0.2);
    border-color: rgba(181, 101, 200, 0.6);
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(181, 101, 200, 0.3);
}

.project-item h3 {
    color: #d4a5e0;
    margin-bottom: 10px;
}

.project-item p {
    color: #d1d5db;
    font-size: 0.9em;
    margin-bottom: 15px;
    text-align: justify;
}

.project-item p:first-of-type {
    color: #b565c8;
    font-size: 1em;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 10px;
    margin-top: 8px;
}

.project-image {
    width: 100%;
    height: 200px;
    margin: 15px 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: rgba(181, 101, 200, 0.05);
    border: 1px solid rgba(181, 101, 200, 0.2);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.1);
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(30, 30, 46, 0.6) 100%);
    pointer-events: none;
}

/* Cuadro 7: Habilidades */
.div7 {
    grid-column: span 3 / span 3;
    grid-row: span 2 / span 2;
    grid-row-start: 5;
    grid-column-start: 3;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-width: 600px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(181, 101, 200, 0.1);
    border: 2px solid rgba(181, 101, 200, 0.3);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1em;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #b565c8;
    background: rgba(181, 101, 200, 0.2);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #9ca3af;
}

/* Botones */
.btn {
    background: linear-gradient(135deg, #b565c8, #a855b8);
    color: white;
    padding: 12px 24px;
    border: 2px solid rgba(181, 101, 200, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(181, 101, 200, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::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: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #c084d4, #b565c8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(181, 101, 200, 0.5);
    border-color: rgba(181, 101, 200, 0.6);
}

/* Sección de habilidades */
.skills-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.skill-category {
    margin-bottom: 25px;
}

.skill-category h3 {
    color: #d4a5e0;
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category h3 i {
    color: #b565c8;
}

/* Cuadro 8: Extras */
.div8 {
    grid-column: span 5 / span 5;
    grid-row: span 2 / span 2;
    grid-row-start: 7;
}

.extras-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.extra-category {
    background: rgba(181, 101, 200, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(181, 101, 200, 0.3);
    transition: all 0.3s ease;
}

.extra-category.full-width {
    grid-column: 1 / 3;
}

.extra-category.full-width .extra-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.extra-category:hover {
    background: rgba(181, 101, 200, 0.15);
    border-color: rgba(181, 101, 200, 0.5);
    transform: translateY(-3px);
}

.extra-category h3 {
    color: #d4a5e0;
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.extra-category h3 i {
    color: #b565c8;
}

.extra-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.extra-item {
    background: rgba(181, 101, 200, 0.1);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 3px solid #b565c8;
    transition: all 0.3s ease;
}

.extra-item:hover {
    background: rgba(181, 101, 200, 0.15);
    transform: translateX(5px);
}

.extra-item h4 {
    color: #e9d5ff;
    font-size: 1em;
    margin: 0 0 5px 0;
}

.extra-item p {
    color: #d4a5e0;
    font-size: 0.9em;
    margin: 0;
}

.current-work {
    margin-top: 10px;
}

.current-work p {
    color: #d1d5db;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Certificaciones Grid */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.certification-item {
    background: rgba(181, 101, 200, 0.1);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(181, 101, 200, 0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.certification-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(181, 101, 200, 0.3);
    border-color: rgba(181, 101, 200, 0.5);
}

.certification-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: rgba(30, 30, 46, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.certification-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 10px;
}

.certification-item:hover .certification-image img {
    transform: scale(1.05);
}

.certification-image::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(181, 101, 200, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.certification-item:hover .certification-image::after {
    opacity: 1;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(181, 101, 200, 0.4);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    background: rgba(181, 101, 200, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.lightbox-close:hover {
    background: rgba(181, 101, 200, 1);
    transform: rotate(90deg);
}

.certification-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.certification-info h4 {
    color: #e9d5ff;
    font-size: 1.1em;
    margin: 0;
    border-bottom: 2px solid #b565c8;
    padding-bottom: 8px;
}

.certification-info p {
    color: #d1d5db;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

/* Responsive */
@media (max-width: 768px) {
    .parent {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }
    
    .div1, .div2, .div3, .div4, .div7, .div8 {
        grid-column: 1;
        grid-row: auto;
    }
    

    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .extras-section {
        grid-template-columns: 1fr;
    }
    
    .extra-category.full-width {
        grid-column: 1;
    }
    
    .extra-category.full-width .extra-items {
        grid-template-columns: 1fr;
    }
}

/* Deshabilitar efectos hover en móviles */
@media (hover: none) and (pointer: coarse) {
    .card,
    .skill-tag {
        transition: none !important;
    }
    
    /* Optimización específica para la sección de skills */
    .div7,
    #habilidades {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        will-change: auto;
    }
}

        
