/* ========================================
   Variables y Reset
   ======================================== */
:root {
    --color-primary: #4169E1;        /* Azul Rey */
    --color-secondary: #2E5090;      /* Azul Rey Oscuro */
    --color-accent: #7B92C8;         /* Azul Claro */
    --color-silver: #C0C0C0;         /* Plata */
    --color-silver-dark: #8B9199;    /* Plata Oscuro */
    --color-bg: #0a0e1a;
    --color-bg-secondary: #151925;
    --color-text: #e8eaed;
    --color-text-muted: #9ca3af;
    --color-border: rgba(192, 192, 192, 0.15);
    --spacing: 1rem;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Modo Claro */
[data-theme="light"] {
    --color-bg: #f0f3f7;
    --color-bg-secondary: #fafbfc;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-border: rgba(65, 105, 225, 0.2);
    --shadow: 0 20px 60px rgba(65, 105, 225, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevenir selección global */
    -webkit-tap-highlight-color: transparent;
}

/* Permitir selección solo en inputs (por si agregas formulario después) */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Prevenir selección de texto */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ========================================
   Canvas de Fondo 3D
   ======================================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* ========================================
   Navegación
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(10, 14, 39, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.5px;
}

.logo-dot {
    color: var(--color-primary);
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--color-text);
    transition: var(--transition);
    border-radius: 3px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-toggle:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: scale(1.1) rotate(20deg);
}

.theme-toggle:active {
    transform: scale(0.95) rotate(20deg);
}

/* Fallback si Font Awesome no carga */
#theme-icon {
    display: inline-block;
}

/* Si el icono no carga, mostrar emoji fallback */
.theme-toggle:empty::before {
    content: '☀️';
    font-size: 1.5rem;
}

[data-theme="light"] .theme-toggle:empty::before {
    content: '🌙';
}

/* Modo claro - ajustes adicionales */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(65, 105, 225, 0.12);
}

[data-theme="light"] #bg-canvas {
    opacity: 0.6;
}

[data-theme="light"] .skill-card,
[data-theme="light"] .project-card,
[data-theme="light"] .contact-item,
[data-theme="light"] .timeline-content,
[data-theme="light"] .stat-item {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(65, 105, 225, 0.15);
}

[data-theme="light"] .skill-card:hover,
[data-theme="light"] .project-card:hover,
[data-theme="light"] .contact-item:hover {
    box-shadow: 0 12px 32px rgba(65, 105, 225, 0.25),
                0 4px 12px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-8px);
    border-color: rgba(65, 105, 225, 0.3);
}

/* Ajustar header de proyectos en modo claro */
[data-theme="light"] .project-image {
    background: linear-gradient(135deg, 
                rgba(65, 105, 225, 1), 
                rgba(46, 80, 144, 1));
}

[data-theme="light"] .project-image::before {
    opacity: 0;  /* ← Sin patrón decorativo si hay imagen */
}

[data-theme="light"] .project-overlay {
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.95), rgba(46, 80, 144, 0.95));
}

[data-theme="light"] .project-img {
    opacity: 1;  /* ← Imagen siempre visible */
}

/* Carrusel en modo claro */
[data-theme="light"] .carousel-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(65, 105, 225, 0.3);
    color: var(--color-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .carousel-btn:hover {
    background: var(--color-primary);
    color: white;
}

[data-theme="light"] .carousel-dot {
    background: rgba(65, 105, 225, 0.2);
    border-color: rgba(65, 105, 225, 0.3);
}

[data-theme="light"] .carousel-dot:hover {
    background: rgba(65, 105, 225, 0.4);
}

/* Responsive para tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .projects-carousel-wrapper {
        padding: 2rem 4rem;
    }
    
    .projects-carousel-container {
        margin: 0;
    }
    
    .project-card {
        min-width: calc((100% - 4rem) / 2);  /* ← 2 tarjetas en tablets */
        max-width: calc((100% - 4rem) / 2);
    }
    
    .carousel-prev {
        left: 0.5rem;
    }
    
    .carousel-next {
        right: 0.5rem;
    }
}

[data-theme="light"] .timeline-content:hover {
    box-shadow: 0 10px 28px rgba(65, 105, 225, 0.2),
                0 3px 10px rgba(0, 0, 0, 0.12);
    border-color: rgba(65, 105, 225, 0.3);
}

[data-theme="light"] .stat-item:hover {
    box-shadow: 0 10px 28px rgba(65, 105, 225, 0.2),
                0 3px 10px rgba(0, 0, 0, 0.12);
    border-color: rgba(65, 105, 225, 0.3);
}

/* Secciones alternadas en modo claro */
[data-theme="light"] .sobre-mi,
[data-theme="light"] .experiencia,
[data-theme="light"] .contacto {
    background: #fafbfc;
}

[data-theme="light"] .habilidades,
[data-theme="light"] .proyectos {
    background: #ffffff;
}

/* Botones en modo claro */
[data-theme="light"] .btn-primary {
    box-shadow: 0 8px 20px rgba(65, 105, 225, 0.3);
}

[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 12px 28px rgba(65, 105, 225, 0.4);
}

[data-theme="light"] .btn-secondary {
    border-color: rgba(65, 105, 225, 0.4);
    background: rgba(65, 105, 225, 0.05);
}

[data-theme="light"] .btn-secondary:hover {
    border-color: var(--color-primary);
    background: rgba(65, 105, 225, 0.1);
}

/* Timeline en modo claro */
[data-theme="light"] .timeline::before {
    background: linear-gradient(180deg, rgba(65, 105, 225, 0.8), rgba(123, 146, 200, 0.8));
}

[data-theme="light"] .timeline-date {
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.2);
}

/* Scroll indicator en modo claro */
[data-theme="light"] .mouse {
    border-color: rgba(65, 105, 225, 0.6);
}

[data-theme="light"] .wheel {
    background: rgba(65, 105, 225, 0.6);
}

/* Footer en modo claro */
[data-theme="light"] .footer {
    background: #ffffff;
    border-top: 1px solid rgba(65, 105, 225, 0.2);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .social-links a {
    background: rgba(65, 105, 225, 0.08);
    border-color: rgba(65, 105, 225, 0.2);
}

[data-theme="light"] .social-links a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 2rem;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--color-text-muted);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.subtitle {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--color-text);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin: 2rem 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
}

.btn {
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    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 ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 10px 30px rgba(65, 105, 225, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(65, 105, 225, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    animation: fadeIn 1s ease-out 1.2s forwards;
    opacity: 0;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--color-text-muted);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--color-text-muted);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

/* ========================================
   Secciones Generales
   ======================================== */
/* Espaciado base para todas las secciones */
.section {
    padding: 5rem 2.5rem;  /* ← Más padding lateral para todas las secciones */
    position: relative;
}

/* Control individual de cada sección */
.hero {
    padding: 0;  /* Hero tiene su propio espaciado */
}

.sobre-mi {
    padding: 5rem 2rem;
}

.habilidades {
    padding: 5rem 2rem 12rem;  /* ← 12rem abajo = 192px */
}

.experiencia {
    padding: 3rem 2rem 1rem;  /* ← Solo 3rem arriba = 48px */
}

.proyectos {
    padding: 1rem 0 12rem;  /* ← SIN padding lateral para que ocupe todo */
    overflow: visible;
}

.contacto {
    padding: 12rem 4rem 4rem;  /* ← 12rem arriba = 192px de separación */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;  /* Padding interno para evitar que el contenido toque los bordes */
    box-sizing: border-box;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;  /* Espacio entre título y contenido */
    background: linear-gradient(135deg, var(--color-text), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
}

/* ========================================
   Sobre Mí
   ======================================== */
.sobre-mi {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
}

.sobre-mi-content {
    max-width: 800px;
    margin: 0 auto;
}

.sobre-mi-text .lead {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.sobre-mi-text p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Habilidades
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
    box-shadow: 0 20px 60px rgba(65, 105, 225, 0.2);
}

.skill-icon {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.skill-card ul {
    list-style: none;
}

.skill-card li {
    color: var(--color-text-muted);
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.skill-card li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* ========================================
   Experiencia
   ======================================== */
.experiencia {
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 4px solid var(--color-bg);
    box-shadow: 0 0 20px rgba(65, 105, 225, 0.5);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.timeline-content:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(10px);
    border-color: var(--color-primary);
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.company {
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content p:last-child {
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* ========================================
   Proyectos - Carrusel
   ======================================== */
.projects-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;  /* ← TODO el ancho de la pantalla */
    margin: 0;
    padding: 2rem 5rem;  /* ← Padding para las flechas */
}

.projects-carousel-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    position: relative;
}

.projects-carousel {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    align-items: stretch;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    /* Cálculo correcto: (100% del contenedor - 2 gaps de 2rem) / 3 tarjetas */
    min-width: calc((100% - 4rem) / 3);
    max-width: calc((100% - 4rem) / 3);
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Link que envuelve toda la tarjeta */
.project-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Botones de navegación FUERA del carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(65, 105, 225, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;  /* ← Más alto para estar sobre todo */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 24px rgba(65, 105, 225, 0.4);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 0.5rem;  /* ← Pegada al borde izquierdo del wrapper */
}

.carousel-next {
    right: 0.5rem;  /* ← Pegada al borde derecho del wrapper */
}

/* Botones deshabilitados */
.carousel-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Indicadores/Dots del carrusel */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 3rem;
    width: 100%;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    width: 32px;
    border-radius: 6px;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 60px rgba(65, 105, 225, 0.3),
                0 0 40px rgba(65, 105, 225, 0.1);
}

/* Efecto de brillo en hover */
.project-card:hover .project-image::before {
    opacity: 1;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.project-image {
    height: 250px;
    min-height: 250px;
    background: linear-gradient(135deg, 
                rgba(65, 105, 225, 0.9), 
                rgba(46, 80, 144, 0.9));
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imagen del proyecto - SIEMPRE VISIBLE */
.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* ← Cubre todo el espacio sin deformarse */
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);  /* ← Efecto zoom suave al hover */
}

/* Patrón decorativo en el fondo del header (solo si NO hay imagen) */
.project-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;  /* ← No interfiere con clics */
}

/* Ocultar patrón si hay imagen */
.project-image:has(.project-img)::before {
    opacity: 0;
}

/* Líneas decorativas (solo si NO hay imagen) */
.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(255, 255, 255, 0.05) 50px,
            rgba(255, 255, 255, 0.05) 51px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(255, 255, 255, 0.05) 50px,
            rgba(255, 255, 255, 0.05) 51px
        );
    opacity: 0.3;
    pointer-events: none;
}

/* Ocultar líneas si hay imagen */
.project-image:has(.project-img)::after {
    opacity: 0;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(65, 105, 225, 0.92), rgba(46, 80, 144, 0.92));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;  /* ← INVISIBLE por defecto */
    transition: opacity 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(5px);
}

.project-card:hover .project-overlay {
    opacity: 1;  /* ← VISIBLE al hacer hover */
}

.project-overlay i {
    font-size: 3.5rem;
    color: white;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Icono visible en el centro del header */
.project-image .fa-external-link-alt {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
}

.project-card:hover .project-image .fa-external-link-alt {
    transform: scale(1.15) rotate(5deg);
    color: white;
}

.project-content {
    padding: 2rem 2rem 3rem;  /* Más padding abajo */
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;  /* Espacio entre elementos */
}

.project-content h3 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--color-text-muted);
    line-height: 1.9;  /* Más espaciado de línea */
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;  /* Empuja los tags al fondo */
    padding-top: 1rem;  /* Espacio extra arriba de los tags */
}

.project-tags span {
    padding: 0.5rem 1rem;
    background: rgba(65, 105, 225, 0.15);
    color: var(--color-accent);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(192, 192, 192, 0.2);
}

/* ========================================
   Contacto
   ======================================== */
.contacto {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
    margin-top: 5rem;  /* ← Margen extra de 5rem = 80px adicionales */
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-lead {
    text-align: center;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 3rem;  /* Espacio entre texto y métodos de contacto */
    line-height: 1.8;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
    box-shadow: 0 15px 40px rgba(65, 105, 225, 0.2);
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    flex-shrink: 0;
}

.contact-icon.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.contact-icon.telegram {
    background: linear-gradient(135deg, #2aabee, #229ed9);
}

.contact-icon.linkedin {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
}

.contact-details h4 {
    color: var(--color-text);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-details p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 3rem 2rem;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-content p {
    color: var(--color-text-muted);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: var(--transition);
    font-size: 1.25rem;
}

.social-links a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-3px);
}

/* ========================================
   Animaciones
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(10px);
        opacity: 0;
    }
}

/* Animación de scroll reveal */
[data-scroll] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-scroll].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(10, 14, 39, 0.98);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding: 2rem 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    [data-theme="light"] .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 30px rgba(65, 105, 225, 0.15);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .nav-actions {
        gap: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* Ajuste responsive para todas las secciones */
    .section,
    .sobre-mi,
    .habilidades,
    .experiencia {
        padding: 3.5rem 1.5rem !important;  /* Espaciado mobile */
    }
    
    .proyectos {
        padding: 4rem 2rem 5rem !important;  /* Más espacio en mobile */
    }
    
    .contacto {
        padding: 5rem 2rem 3rem !important;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .skills-grid,
    .contact-methods {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    /* Carrusel responsive */
    .projects-carousel-wrapper {
        padding: 2rem 3.5rem;
    }
    
    .projects-carousel-container {
        margin: 0;
    }
    
    .projects-carousel {
        padding: 0;
    }
    
    .project-card {
        min-width: calc(100% - 2rem);  /* ← 1 tarjeta en mobile */
        max-width: calc(100% - 2rem);
    }
    
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .carousel-prev {
        left: 0.25rem;
    }
    
    .carousel-next {
        right: 0.25rem;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-dot {
        left: 1px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Mejoras de Accesibilidad
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mejora de contraste para modo de alto contraste */
@media (prefers-contrast: high) {
    :root {
        --color-text: #ffffff;
        --color-text-muted: #cccccc;
        --color-border: rgba(255, 255, 255, 0.3);
    }
}

/* ========================================
   Notificaciones Toast
   ======================================== */
#toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    color: #1a1a1a;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 280px;
    pointer-events: all;
    transform: translateX(400px);
    animation: slideIn 0.3s ease forwards, slideOut 0.3s ease 2.7s forwards;
}

[data-theme="dark"] .toast {
    background: rgba(21, 25, 50, 0.95);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.875rem;
    opacity: 0.8;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Toast en mobile */
@media (max-width: 768px) {
    #toast-container {
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

