/* ============================================
   PSICOTÉCNICOS PROSELECCIÓN - MAIN CSS
   Sitio Web Multi-Oposición
   ============================================ */

/* --- VARIABLES CSS (Paleta de Colores) --- */
:root {
    /* Primarios */
    --primary: #4F46E5;        /* Indigo-600 */
    --primary-dark: #4338CA;   /* Indigo-700 */
    --primary-light: #818CF8;  /* Indigo-400 */

    /* Secundarios */
    --secondary: #F59E0B;      /* Amber-500 */
    --accent: #10B981;         /* Emerald-500 */
    --danger: #EF4444;         /* Red-500 */

    /* Neutros */
    --gray-50: #F9FAFB;
    --gray-900: #111827;

    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- RESET Y BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- GLASSMORPHISM EFFECTS --- */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- GRADIENTES VIBRANTES --- */
.gradient-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
}

/* --- ANIMACIONES PERSONALIZADAS --- */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-pulse-scale {
    animation: pulse-scale 2s ease-in-out infinite;
}

/* --- BOTONES PERSONALIZADOS --- */
.btn-primary {
    @apply bg-indigo-600 text-white px-8 py-3 rounded-lg font-semibold;
    @apply hover:bg-indigo-700 transform hover:-translate-y-1 hover:shadow-xl;
    @apply transition-all duration-300 ease-in-out;
}

.btn-secondary {
    @apply bg-amber-500 text-white px-8 py-3 rounded-lg font-semibold;
    @apply hover:bg-amber-600 transform hover:-translate-y-1 hover:shadow-xl;
    @apply transition-all duration-300 ease-in-out;
}

.btn-outline {
    @apply border-2 border-indigo-600 text-indigo-600 px-8 py-3 rounded-lg font-semibold;
    @apply hover:bg-indigo-600 hover:text-white transform hover:-translate-y-1 hover:shadow-xl;
    @apply transition-all duration-300 ease-in-out;
}

/* --- CARDS CON HOVER EFFECT --- */
.card-hover {
    @apply transform transition-all duration-300 ease-in-out;
    @apply hover:-translate-y-2 hover:shadow-2xl;
}

/* --- SOMBRAS PERSONALIZADAS --- */
.shadow-custom {
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.15);
}

.shadow-custom-hover:hover {
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.25);
}

/* --- EFECTOS DE TEXTO --- */
.text-gradient {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- SCROLL SMOOTH PARA ANIMACIONES --- */
[data-aos] {
    pointer-events: auto;
}

/* --- RESPONSIVE UTILITIES --- */
@media (max-width: 768px) {
    .mobile-menu-open {
        overflow: hidden;
    }
}

/* --- UTILIDADES ADICIONALES --- */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* --- OCULTAR SCROLLBAR PERO MANTENER FUNCIONALIDAD --- */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- FOCUS STATES ACCESIBLES --- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- ESTADOS DE CARGA --- */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* --- TRANSICIONES GLOBALES --- */
a, button {
    transition: all 0.3s ease-in-out;
}

/* ============================================
   MEJORAS SaaS - LOOK & FEEL PROFESIONAL
   ============================================ */

/* --- 1. HERO SECTION: FONDO ANIMADO --- */
.hero-bg {
    background: radial-gradient(circle at 0% 0%, #0ea5e9 0%, transparent 60%),
                radial-gradient(circle at 100% 100%, #6366f1 0%, transparent 60%),
                linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #4F46E5 100%);
    background-size: 200% 200%;
    animation: bgMove 20s infinite alternate ease-in-out;
    position: relative;
    min-height: 600px;
}

@keyframes bgMove {
    0% {
        background-position: 0% 0%, 100% 100%, 0% 50%;
    }
    100% {
        background-position: 20% 10%, 80% 90%, 100% 50%;
    }
}

/* --- 2. BOTÓN PRIMARY MEJORADO (CTA) --- */
.btn-primary-saas {
    background: white;
    color: #4F46E5;
    font-weight: 700;
    transform: translateY(0);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary-saas:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-primary-saas:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- 3. DASHBOARD CONTAINER (GLASSMORPHISM + BORDE LUMINOSO) --- */
.dashboard-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.9));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 3px solid transparent;
    background-image:
        linear-gradient(white, white),
        linear-gradient(135deg, #4F46E5, #7C3AED, #3B82F6, #10B981);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow:
        0 20px 60px rgba(79, 70, 229, 0.15),
        0 0 0 1px rgba(79, 70, 229, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dashboard-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED, #3B82F6, #10B981);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.6;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.2);
    }
}

.dashboard-container:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 30px 80px rgba(79, 70, 229, 0.25),
        0 0 0 1px rgba(79, 70, 229, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dashboard-container img {
    filter: brightness(1.1) contrast(0.95) saturate(1.1);
    transition: filter 0.3s ease;
}

.dashboard-container:hover img {
    filter: brightness(1.15) contrast(1) saturate(1.15);
}

/* --- LEGACY: Dashboard Mockup (mantener por compatibilidad) --- */
.dashboard-mockup {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

.dashboard-mockup h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    animation: slideIn 0.5s ease-out both;
}

.dashboard-card:nth-child(2) { animation-delay: 0.1s; }
.dashboard-card:nth-child(3) { animation-delay: 0.2s; }
.dashboard-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 8px;
    animation: fillProgress 1.5s ease-out both;
}

@keyframes fillProgress {
    from { width: 0%; }
}

/* --- 4. CARDS OPOSICIONES CON HOVER MEJORADO --- */
.card-oposicion {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border-radius: 16px;
    overflow: hidden;
}

.card-oposicion:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.16);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(79, 70, 229, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* --- 5. WIDGETS VISUALES (IA, PSICÓLOGO, GAMIFICACIÓN) --- */
.feature-widget {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    border: 2px solid rgba(79, 70, 229, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.15);
}

/* Altura uniforme para todas las imágenes de widgets */
.feature-widget img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

.widget-ia {
    background: linear-gradient(135deg, #EBF4FF, #DFF0FF);
    border-color: #3B82F6;
}

.widget-psicologo {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-color: #F59E0B;
}

.widget-gamificacion {
    background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
    border-color: #10B981;
}

.xp-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    animation: xpGlow 2s ease-in-out infinite;
}

@keyframes xpGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
}

.xp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

.streak-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 700;
    color: #DC2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.avatar-widget {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    border: 3px solid white;
}

.chat-bubble {
    background: white;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    margin-top: 8px;
}

.chat-bubble::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* --- 6. TIMELINE HORIZONTAL (CÓMO FUNCIONA) --- */
.timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    top: 50px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, #E5E7EB, #D1D5DB, #E5E7EB);
    z-index: 0;
}

.timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-step.active {
    opacity: 1;
    transform: scale(1.05);
}

.timeline-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 4px solid white;
    transition: all 0.5s ease;
}

.timeline-step.active .timeline-icon {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
    transform: scale(1.1);
}

.timeline-number {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: #4F46E5;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 14px;
}

/* --- 7. TESTIMONIOS MEJORADOS --- */
.testimonial-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.testimonial-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.stars {
    display: flex;
    gap: 4px;
    color: #F59E0B;
    font-size: 16px;
}

.testimonial-badge {
    display: inline-block;
    background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
    color: #166534;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Fix Swiper height for testimonials */
.testimonials-swiper .swiper-slide {
    height: auto !important;
    min-height: 320px !important;
}

.testimonials-swiper .swiper-wrapper {
    align-items: stretch;
}

.testimonials-swiper .testimonial-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Force visibility of stars and badges */
.testimonials-swiper .stars {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.testimonials-swiper .testimonial-badge {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* --- 8. PRICING PLAN DESTACADO --- */
.pricing-card-featured {
    transform: scale(1.05);
    border: 3px solid #4F46E5;
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.25);
    position: relative;
    z-index: 10;
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.benefit-icon {
    color: #10B981;
    font-size: 20px;
    margin-right: 8px;
}

/* --- 9. SCROLL REVEAL ANIMATIONS --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 10. MICROCOPYS DE CONFIANZA --- */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

/* --- RESPONSIVE: MOBILE --- */
@media (max-width: 768px) {
    .hero-bg {
        min-height: 500px;
    }

    .dashboard-mockup {
        margin-top: 32px;
    }

    .timeline-container {
        flex-direction: column;
        gap: 32px;
    }

    .timeline-line {
        display: none;
    }

    .timeline-step {
        opacity: 1;
    }

    .pricing-card-featured {
        transform: scale(1);
        margin: 16px 0;
    }
}
