/* ===================================================================
 * PORTFOLIO DE JAVIER MESONERO MORO - STYLES.CSS
 * ===================================================================
 *
 * Estructura:
 * 1.  Estilos Generales y de Fondo
 * 2.  Definición de Temas (Claro/Oscuro)
 * 3.  Componentes Principales (Navbar, Modals)
 * 4.  Componentes de UI (Glassmorphism, Tarjetas, Badges)
 * 5.  Efectos y Animaciones
 * 6.  Clases de Utilidad (Gradient Text, Glow)
 * 7.  Componentes Específicos (Carrusel, Estadísticas)
 * 8.  Diseño Responsivo (Media Queries)
 *
 * =================================================================== */


/* =================================================================== */
/* 1. ESTILOS GENERALES Y DE FONDO
/* =================================================================== */
body {
    font-family: "Inter", sans-serif;
}

.gradient-bg {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 25%, #6366f1 50%, #8b5cf6 75%, #ec4899 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    opacity: 0.4;
}

.shape:nth-child(1) {
    width: 120px; height: 120px; top: 10%; left: 15%;
    background: radial-gradient(circle, #22d3ee, #0ea5e9);
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 80px; height: 80px; top: 30%; right: 20%;
    background: radial-gradient(circle, #8b5cf6, #6366f1);
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 150px; height: 150px; bottom: 15%; left: 10%;
    background: radial-gradient(circle, #ec4899, #f97316);
    animation-delay: 4s;
}

.shape:nth-child(4) {
    width: 90px; height: 90px; top: 60%; right: 10%;
    background: radial-gradient(circle, #eab308, #22d3ee);
    animation-delay: 6s;
}


/* =================================================================== */
/* 2. DEFINICIÓN DE TEMAS (CLARO/OSCURO)
/* =================================================================== */

/* === TEMA CLARO === */
body.light-theme {
    --bg-primary: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 25%, #ede9fe 50%, #fdf2f8 75%, #fff1f2 100%);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --card-bg: rgba(255, 255, 255, 0.8);
    --navbar-bg: rgba(255, 255, 255, 0.9);
}

body.light-theme .gradient-bg {
    background: var(--bg-primary);
}

body.light-theme .glassmorphism {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-theme .navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .text-white,
body.light-theme .text-gray-300 {
    color: var(--text-primary) !important;
}

body.light-theme .text-gray-400 {
    color: var(--text-secondary) !important;
}

body.light-theme .shape {
    opacity: 0.2;
}

/* === INTERRUPTOR DE TEMA === */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(14, 165, 233, 0.3);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.5);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: all 0.3s ease;
}

.theme-icon.sun { right: 6px; color: #fbbf24; opacity: 0; }
.theme-icon.moon { left: 6px; color: #22d3ee; opacity: 1; }

body.light-theme .theme-toggle {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: rgba(251, 191, 36, 0.3);
}

body.light-theme .theme-toggle::before {
    transform: translateX(28px);
    background: linear-gradient(135deg, #fff, #f8fafc);
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

body.light-theme .theme-icon.sun { opacity: 1; }
body.light-theme .theme-icon.moon { opacity: 0; }


/* =================================================================== */
/* 3. COMPONENTES PRINCIPALES (NAVBAR, MODALS)
/* =================================================================== */
.navbar {
    background: rgba(14, 165, 233, 0.1);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
    background: rgba(14, 165, 233, 0.2);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.2);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    padding: 2rem;
    transform: scale(0.9) translateY(50px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.pdf-viewer {
    width: 100%;
    height: 400px;
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 0.5rem;
    background: #1e293b;
}

body.light-theme .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .pdf-viewer {
    background: #f8fafc;
    border-color: rgba(14, 165, 233, 0.2);
}


/* =================================================================== */
/* 4. COMPONENTES DE UI (GLASSMORPHISM, TARJETAS, BADGES)
/* =================================================================== */
.glassmorphism {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-hover {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 30px 60px rgba(14, 165, 233, 0.3);
}

.project-card {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(34, 211, 238, 0.05) 25%, rgba(139, 92, 246, 0.1) 50%, rgba(236, 72, 153, 0.05) 75%, rgba(14, 165, 233, 0.1) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #0ea5e9, #22d3ee, #8b5cf6, #ec4899);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

.social-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-hover:hover {
    transform: translateY(-8px) scale(1.15) rotate(5deg);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.5);
}

.tech-badge {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee, #8b5cf6);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.tech-badge:hover {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
    animation-duration: 1s;
}


/* =================================================================== */
/* 5. EFECTOS Y ANIMACIONES
/* =================================================================== */

/* --- Animaciones de entrada --- */
.fade-in { opacity: 0; transform: translateY(50px); transition: all 1s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.slide-in-left { opacity: 0; transform: translateX(-50px); transition: all 1s ease-out; }
.slide-in-left.visible { opacity: 1; transform: translateX(0); }

.slide-in-right { opacity: 0; transform: translateX(50px); transition: all 1s ease-out; }
.slide-in-right.visible { opacity: 1; transform: translateX(0); }

.stagger-animation { animation-fill-mode: both; }
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
/* ... y así sucesivamente */

/* --- Keyframes --- */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    33% { transform: translateY(-30px) rotate(120deg) scale(1.1); }
    66% { transform: translateY(15px) rotate(240deg) scale(0.9); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse-magical {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7), 0 0 30px rgba(34, 211, 238, 0.3);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 20px rgba(14, 165, 233, 0), 0 0 50px rgba(34, 211, 238, 0.6);
    }
}

@keyframes textGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes countUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* =================================================================== */
/* 6. CLASES DE UTILIDAD (GRADIENT TEXT, GLOW)
/* =================================================================== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: linear-gradient(45deg, #0ea5e9, #22d3ee);
    animation: blink 1.5s infinite;
}

.scroll-indicator {
    animation: bounce 2s infinite;
    color: #22d3ee;
    filter: drop-shadow(0 0 10px #22d3ee);
}

.pulse-slow {
    animation: pulse-magical 5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.gradient-text {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee, #8b5cf6, #ec4899);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 4s ease-in-out infinite;
}

.fantasy-glow {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.3), 0 0 40px rgba(34, 211, 238, 0.2), 0 0 60px rgba(139, 92, 246, 0.1);
}

.interactive-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-element:hover {
    filter: brightness(1.1) saturate(1.2);
}


/* =================================================================== */
/* 7. COMPONENTES ESPECÍFICOS (CARRUSEL, ESTADÍSTICAS)
/* =================================================================== */
.carousel-slide, .gallery-image {
    transition: opacity 0.5s ease-in-out;
}

.mobile-screenshot {
    width: auto !important;
    height: 400px !important;
    max-width: 250px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-dot.active, .carousel-indicator.active {
    opacity: 1;
    transform: scale(1.2);
}

.carousel-indicator.active {
    background-color: #3b82f6;
}

.gallery-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-10px);
}

.counter {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter.animated {
    animation: countUp 0.6s ease-out;
}


/* =================================================================== */
/* 8. DISEÑO RESPONSIVO (MEDIA QUERIES)
/* =================================================================== */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem !important; }
    .hero-subtitle { font-size: 1.125rem !important; }
    .section-title { font-size: 2rem !important; }
    .card-padding { padding: 1.5rem !important; }
    .tech-badge { font-size: 0.75rem !important; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem !important; }
    .hero-subtitle { font-size: 1rem !important; }
    .section-title { font-size: 1.75rem !important; }
    .card-padding { padding: 1.25rem !important; }
}