/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #8b5cf6;
    --secondary-color: #10b981;
    --text-color: #f8fafc;
    --text-light: #cbd5e1;
    --text-muted: #94a3b8;
    --bg-color: #0f172a;
    --bg-dark: #020617;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --border-color: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --gradient: linear-gradient(135deg, #7c3aed 0%, #10b981 100%);
}

/* ==================== BASE STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-color);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
    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: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== HEADER ==================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ==================== HOME SECTION ==================== */
.home {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding-top: 150px;
    position: relative;
    overflow: hidden;
}

.home::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(50px);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
    }
}

/* CONTENEDOR FLEX IMPORTANTE */
.home .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    width: 100%;
}

.home-content {
    flex: 1;
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.home-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.home-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.home-content h3 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.multiple-text {
    color: var(--primary-color);
}

.home-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.social-media {
    display: flex;
    margin-bottom: 2rem;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 12px;
    margin-right: 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-media a:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: var(--shadow);
}

.home-img {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    max-width: 400px;
}

.home-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 4px solid var(--bg-light);
    animation: float 3s ease-in-out infinite;
}

.home-img-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(20px);
    z-index: -1;
}

.home-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: var(--transition);
}

.home-img-wrapper:hover img {
    transform: scale(1.05);
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE HOME ==================== */
@media (max-width: 1200px) {
    .home .container {
        gap: 3rem;
    }
    
    .home-img-wrapper {
        max-width: 300px;
    }
}

@media (max-width: 992px) {
    .home .container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .home-content {
        max-width: 100%;
    }
    
    .home-img {
        max-width: 300px;
    }
    
    .home-img-wrapper {
        max-width: 250px;
    }
    
    .home-content h1 {
        font-size: 3rem;
    }
    
    .home-content h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .home {
        padding-top: 120px;
    }
    
    .home-content h1 {
        font-size: 2.5rem;
    }
    
    .home-content h3 {
        font-size: 1.5rem;
    }
    
    .home-img-wrapper {
        max-width: 220px;
    }
    
    .social-media {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .home-content h1 {
        font-size: 2rem;
    }
    
    .home-content h3 {
        font-size: 1.3rem;
    }
    
    .home-img-wrapper {
        max-width: 200px;
    }
    
    .social-media a {
        width: 45px;
        height: 45px;
        margin-right: 0.5rem;
    }
}

/* ==================== ABOUT SECTION ==================== */
.about {
    background: var(--bg-dark);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(40px);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 2;
}

.about-img {
    flex: 1;
    text-align: center;
}

.about-img img {
    max-width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.about-text {
    flex: 1;
}

.about-text h2 {
    text-align: left;
}

.about-text h2::after {
    left: 0;
    transform: none;
}

.about-text p {
    color: var(--text-light);
}

.skills {
    margin-top: 2rem;
}

.skill {
    margin-bottom: 1.5rem;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.skill-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.skill-per {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    position: relative;
    animation: fillBars 2.5s 1;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

@keyframes fillBars {
    from {
        width: 0;
    }
}

/* ==================== SERVICES SECTION ==================== */
.services {
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--gradient);
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(30px);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.service-card {
    background: var(--bg-light);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-light);
}

.service-icon {
    font-size: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.service-card p {
    color: var(--text-light);
}

/* ==================== PORTFOLIO SECTION ==================== */
.portfolio {
    background: var(--bg-dark);
    position: relative;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.portfolio-item {
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-light);
}

.portfolio-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.portfolio-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.portfolio-item:hover .portfolio-img::before {
    opacity: 0.1;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-img img {
    transform: scale(1.1);
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.portfolio-info p {
    color: var(--text-light);
}

.portfolio-links {
    display: flex;
    margin-top: 1rem;
}

.portfolio-links a {
    margin-right: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.portfolio-links a:hover {
    color: var(--primary-light);
}

/* ==================== CONTACT SECTION ==================== */
.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(10px);
    border-color: var(--primary-color);
}

.contact-icon {
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-item h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: var(--text-light);
    margin: 0;
}

.contact-form {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: var(--bg-dark);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.footer-social {
    display: flex;
}

.footer-social a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: var(--bg-light);
    border-radius: 12px;
    margin-left: 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.footer-social a:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-5px);
    border-color: transparent;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    h1 {
        font-size: 2.8rem;
    }

    .home-content h3 {
        font-size: 1.8rem;
    }

    .about-content {
        flex-direction: column;
    }

    .about-text h2 {
        text-align: center;
    }

    .about-text h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 70%;
        height: calc(100vh - 70px);
        background: var(--bg-light);
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        border-left: 1px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active div:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active div:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active div:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .home {
        flex-direction: column;
        text-align: center;
    }

    .home-content {
        padding-right: 0;
        margin-bottom: 3rem;
    }

    .social-media {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

/* ==================== GLOW EFFECTS ==================== */
.glow {
    position: relative;
}

.glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.glow:hover::before {
    opacity: 1;
    filter: blur(10px);
}

/* ==================== PARTICLE BACKGROUND ==================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.1;
    animation: float-particle 20s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
    }
}


/* Estilos para el botón de carga */
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Estilos para los mensajes del formulario */
.form-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background: var(--secondary-color);
    color: white;
    border: 1px solid var(--secondary-color);
}

.form-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Validación de formularios */
.form-control:invalid {
    border-color: #f87171;
}

.form-control:valid {
    border-color: var(--secondary-color);
}