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

:root {
    --primary-color: #8C00FF;
    --secondary-color: #450693;
    --accent-color: #FF3F7F;
    --accent-yellow: #FFC400;
    --dark-bg: #0a0514;
    --light-bg: #f8f9fa;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --gradient-1: linear-gradient(135deg, #8C00FF 0%, #450693 100%);
    --gradient-2: linear-gradient(135deg, #FF3F7F 0%, #FFC400 100%);
    --gradient-3: linear-gradient(135deg, #8C00FF 0%, #FF3F7F 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

/* Banner Principal */
.banner {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    overflow: hidden;
    transform: skewY(-2deg);
    margin-bottom: 80px;
}

.banner-content {
    transform: skewY(2deg);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 40px 20px;
}

.banner-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
    position: relative;
    display: inline-block;
}

.gradient-text {
    position: relative;
    background: linear-gradient(
        90deg,
        #8C00FF 0%,
        #8C00FF 25%,
        #FF3F7F 50%,
        #FFC400 75%,
        #8C00FF 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    animation: gradientFlow 4s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 150%;
    }
}

.banner-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.banner-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn {
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Indicador de scroll */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--white);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sección de Introducción */
.intro-section {
    padding: 100px 0;
    background: var(--light-bg);
    transform: skewY(-2deg);
    margin: 80px 0;
}

.intro-section .container {
    transform: skewY(2deg);
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
}

.intro-image {
    position: relative;
}

.image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
    max-width: 300px;
    margin: 0 auto;
}

.image-wrapper:hover {
    transform: rotate(0deg) scale(1.05);
}

.image-placeholder {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.profile-image {
    width: 75%;
    height: 75%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    padding: 8px;
}

.profile-image:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.intro-text {
    animation: fadeInUp 1s ease-out;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.intro-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

.intro-stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Sección de Habilidades */
.skills-section {
    padding: 100px 0;
    background: var(--white);
    transform: skewY(2deg);
    margin: 80px 0;
}

.skills-section .container {
    transform: skewY(-2deg);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 60px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.centered-category {
    grid-column: 2;
    max-width: 300px;
    justify-self: center;
}

@media (max-width: 968px) {
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .centered-category {
        grid-column: 1 / -1;
        max-width: 100%;
        justify-self: stretch;
    }
}

.skill-category {
    background: var(--light-bg);
    padding: 40px;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.skill-category:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--white);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-sm);
}

.skill-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 10px;
}

.skill-name {
    font-weight: 500;
    color: var(--text-dark);
}

/* Sección de Proyectos */
.projects-section {
    padding: 100px 0;
    background: var(--light-bg);
    transform: skewY(2deg);
    margin: 80px 0;
}

.projects-section .container {
    transform: skewY(-2deg);
}

/* Grid de proyectos en tarjetas */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-card-header {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
}

.project-card-ribbon {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 999px;
    text-align: left;
    white-space: nowrap;
    z-index: 2;
    pointer-events: none;
}

/* Ribbon "Nuevo" en esquina inferior derecha, inclinado */
.project-card-ribbon-new {
    position: absolute;
    right: 16px;
    bottom: 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: var(--white);
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    transform: rotate(-12deg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.project-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.project-card-description {
    color: var(--text-light);
    line-height: 1.6;
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    padding: 4px 12px;
    background: var(--light-bg);
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--text-dark);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-light);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--primary-color);
    transform: scale(1.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--light-bg);
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1002;
}

.modal-close:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid var(--light-bg);
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.modal-body {
    padding: 30px 40px 40px;
}

.modal-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.modal-image {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    background: var(--gradient-1);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-image:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 20px;
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* Lightbox para imágenes completas */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    z-index: 2001;
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 60px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2002;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2002;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 90vw;
        max-height: 90vh;
        padding: 50px 10px;
    }
    
    .lightbox-image {
        max-height: 80vh;
    }
    
    .lightbox-prev {
        left: 5px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-next {
        right: 5px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
    }
    
    .lightbox-counter {
        bottom: 5px;
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Sección de Contacto */
.contact-section {
    padding: 100px 0;
    background: var(--white);
    transform: skewY(-2deg);
    margin: 80px 0;
}

.contact-section .container {
    transform: skewY(2deg);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.contact-item {
    text-align: center;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.contact-item h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.contact-item p {
    color: var(--text-light);
}

.contact-open-btn {
    margin-top: 10px;
    cursor: pointer;
}

.contact-form {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    flex: 1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(140, 0, 255, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit {
    margin-top: 8px;
    cursor: pointer;
}

/* Wrapper del formulario de contacto (loader + feedback) */
.contact-form-wrapper {
    position: relative;
    min-height: 200px;
}

.contact-form-loader {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.contact-form-loader.active {
    display: flex;
}

.contact-form-loader p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
}

.contact-form-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--light-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: contact-spin 0.8s linear infinite;
}

@keyframes contact-spin {
    to { transform: rotate(360deg); }
}

.contact-form-feedback {
    display: none;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

.contact-form-feedback.active {
    display: block;
}

.contact-form-feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.contact-form-feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Footer */
/* Bubbles flotantes de contacto (WhatsApp + Email) */
.contact-bubbles {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 1000;
    pointer-events: none;
}

.contact-bubbles > * {
    pointer-events: auto;
}

.contact-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.contact-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.contact-bubble:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.contact-bubble-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: var(--white);
}

.contact-bubble-email {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
}

.bubble-icon {
    width: 28px;
    height: 28px;
}

.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-content {
        grid-template-columns: 1fr;
    }

    .image-wrapper {
        transform: rotate(0deg);
        max-width: 300px;
        margin: 0 auto;
    }

    .intro-stats {
        justify-content: center;
    }

    .carousel-container {
        padding: 0 50px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .modal-images {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .banner-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .carousel-container {
        padding: 0 40px;
    }
}
