/* Custom CSS for DOF Newsletter Website */
/* 
 * CONFIGURACIÓN DE FUENTE PRINCIPAL
 * Para cambiar la fuente del sitio web, solo necesitas:
 * 1. Importar la nueva fuente en el HTML (Google Fonts o local)
 * 2. Cambiar la variable --primary-font abajo
 * 3. ¡Listo! Toda la página usará la nueva fuente automáticamente
 * 
 * FUENTE ACTUAL: Lexend
 * ¿Por qué Lexend es perfecta para nuestro newsletter legal?
 * 
 * ✅ VENTAJAS DE LEXEND:
 * • Mejora la velocidad de lectura hasta un 25%
 * • Aumenta la comprensión del texto leído
 * • Reduce la fatiga visual durante lecturas largas
 * • Diseñada específicamente para mejorar la legibilidad
 * • Más accesible para personas con dislexia
 * • Optimizada para contenido informativo y educativo
 * • Excelente para textos legales complejos simplificados
 * 
 * 🎯 IDEAL PARA: Newsletters, documentos legales, contenido educativo
 * 📚 INVESTIGACIÓN: Basada en estudios de Bonnie Shaver-Troup (Educational Psychology)
 */

:root {
    /* Configuración de fuente principal - CAMBIAR AQUÍ PARA NUEVA FUENTE */
    --primary-font: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Colores del tema */
    --navy-blue: #0F2A3D;
    /* Más oscuro para mejor contraste */
    --winter-sea: #2E5266;
    /* Más oscuro para mejor contraste */
    --beige: #8B7355;
    /* Más oscuro para mejor contraste en texto */
    --vintage: #FFFFFF;
    /* Blanco puro para fondos */
    --light-beige: #F5F2ED;
    /* Beige claro para fondos alternativos */
    --white: #ffffff;
    --off-white: #fafafa;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    /* Más oscuro para mejor contraste */
    --gray-700: #374151;
    /* Más oscuro para mejor contraste */
    --gray-800: #1f2937;
    /* Nuevo color para texto principal */
    --gray-900: #111827;
    /* Texto principal más oscuro */
    --success-green: #22543d;
    /* Verde oscuro para mensajes de éxito */
    --brand-green: #059669;
    /* Verde de la marca para botones DOF */
    --brand-green-dark: #047857;
    /* Verde oscuro de la marca para hover */
    --error-red: #742a2a;
    /* Rojo oscuro para errores */
}

/* Configuración de fuente principal */
.font-comfortaa {
    font-family: var(--primary-font);
}

/* Aplicar fuente principal a todo el body por defecto */
body {
    font-family: var(--primary-font);
}

/* Tailwind CSS Custom Colors Configuration */
.bg-navy-blue {
    background-color: var(--navy-blue);
}

.bg-winter-sea {
    background-color: var(--winter-sea);
}

.bg-beige {
    background-color: var(--beige);
}

.bg-vintage {
    background-color: var(--vintage);
}

.bg-light-beige {
    background-color: var(--light-beige);
}

.bg-gray-800 {
    background-color: var(--gray-800);
}

.text-navy-blue {
    color: var(--navy-blue);
}

.text-winter-sea {
    color: var(--winter-sea);
}

.text-beige {
    color: var(--beige);
}

.text-vintage {
    color: var(--vintage);
}

.text-gray-800 {
    color: var(--gray-800);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-white {
    color: var(--white);
}

.text-success-green {
    color: var(--success-green);
}

.text-error-red {
    color: var(--error-red);
}

.bg-brand-green {
    background-color: var(--brand-green);
}

.bg-brand-green-dark {
    background-color: var(--brand-green-dark);
}

.text-brand-green {
    color: var(--brand-green);
}

.border-brand-green {
    border-color: var(--brand-green);
}

.border-navy-blue {
    border-color: var(--navy-blue);
}

.border-winter-sea {
    border-color: var(--winter-sea);
}

.border-beige {
    border-color: var(--beige);
}

.border-vintage {
    border-color: var(--vintage);
}

.hover\:bg-winter-sea:hover {
    background-color: var(--winter-sea);
}

.hover\:bg-beige:hover {
    background-color: var(--beige);
}

.hover\:text-winter-sea:hover {
    color: var(--winter-sea);
}

.focus\:ring-winter-sea:focus {
    --tw-ring-color: var(--winter-sea);
    box-shadow: 0 0 0 3px rgba(69, 104, 130, 0.1);
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom Styles */
.hero-gradient {
    background: linear-gradient(135deg, var(--navy-blue) 0%, var(--winter-sea) 100%);
}

.subscription-gradient {
    background: linear-gradient(90deg, var(--winter-sea) 0%, var(--beige) 100%);
}

/* Form Styles */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.form-input:focus {
    border-color: var(--winter-sea);
    box-shadow: 0 0 0 3px rgba(69, 104, 130, 0.1);
    outline: none;
}

.form-input.error {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

/* Button Styles */
.btn-primary {
    background-color: var(--navy-blue);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn-primary:hover {
    background-color: var(--winter-sea);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(27, 60, 83, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--navy-blue);
    border: 2px solid var(--navy-blue);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--navy-blue);
    color: white;
}

/* Card Styles */
.feature-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--winter-sea);
}

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.message-success {
    background-color: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.message-error {
    background-color: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .subscription-form {
        padding: 1.5rem;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--winter-sea);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--navy-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .hero-gradient,
    .subscription-gradient {
        background: white !important;
        color: black !important;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --cream: #2d3748;
        --white: #1a202c;
        --off-white: #2d3748;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--vintage);
}

::-webkit-scrollbar-thumb {
    background: var(--winter-sea);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--navy-blue);
}

/* Newsletter Preview Styles */
.newsletter-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.newsletter-preview h4 {
    color: var(--navy-blue);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.newsletter-preview p {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

.newsletter-preview .meta {
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Statistics Counter Animation */
.stat-counter {
    font-weight: 700;
    color: var(--navy-blue);
}

/* Testimonial Styles */
.testimonial {
    background: white;
    border-left: 4px solid var(--winter-sea);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.testimonial blockquote {
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.testimonial cite {
    font-weight: 600;
    color: var(--navy-blue);
    font-style: normal;
}

/* Enhanced Article Cards Styles */
.article-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: #e2e8f0;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover::before {
    opacity: 1;
}

/* Priority Badge Animations */
.priority-badge {
    position: relative;
    overflow: hidden;
}

.priority-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.article-card:hover .priority-badge::before {
    left: 100%;
}

/* Content Transition Animations */
.content-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-fade-in {
    animation: contentFadeIn 0.5s ease-out forwards;
}

.content-fade-out {
    animation: contentFadeOut 0.3s ease-in forwards;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes contentFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Button Enhancements */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::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-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:active {
    transform: scale(0.98);
}

/* Loading States for Articles */
.article-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Enhanced Gradient Backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Section Background Enhancements */
.section-enhanced {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.section-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .article-card {
        margin-bottom: 1.5rem;
    }
    
    .article-card:hover {
        transform: translateY(-4px);
    }
    
    .btn-enhanced {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Mobile-optimized buttons */
    .saber-mas-btn {
        min-height: 44px; /* iOS recommended touch target */
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
    
    .dof-btn {
        min-height: 44px;
        min-width: 80px;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
        touch-action: manipulation; /* Prevents zoom on double-tap */
    }
    
    /* Larger touch targets for mobile */
    .article-card .flex.items-center.justify-between.space-x-3 {
        gap: 0.5rem;
    }
    
    .article-card .flex.items-center.justify-between.space-x-3 > * {
        flex: 1;
        min-width: 0;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .content-transition,
    .btn-enhanced {
        transition: none;
        animation: none;
    }
    
    .article-card:hover {
        transform: none;
    }
}

/* Focus States for Better Accessibility */
.article-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn-enhanced:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Enhanced Button Styles for Article Cards */
.saber-mas-btn {
    position: relative;
    overflow: hidden;
}

.saber-mas-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;
}

.saber-mas-btn:hover::before {
    left: 100%;
}

/* DOF Button Specific Styles */
.dof-btn {
    position: relative;
    overflow: hidden;
}

.dof-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;
}

.dof-btn:hover::before {
    left: 100%;
}

/* Button Glow Effects */
.btn-glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-glow-green {
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.3);
}

.btn-glow-orange {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.btn-glow-indigo {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

.btn-glow-purple {
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

/* DOF Button Mobile Optimizations */
.dof-mobile-btn {
    /* Larger touch target for mobile */
    min-height: 44px;
    min-width: 88px;
    
    /* Better visual feedback */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Prevent text selection on touch */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Improve touch responsiveness */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dof-mobile-btn:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}