/* ============================================
   EL VALLE ENCANTADO - ESTILOS GLOBALES
   ============================================ */

/* Variables CSS */
:root {
    --navy-dark: #1a2332;
    --navy-medium: #2d3e50;
    --gold: #f4d03f;
    --gold-light: #ffd700;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --accent-red: #e74c3c;
    --accent-teal: #16a085;
    --human-badge: #2ecc71;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body y fondo */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-medium) 100%);
    color: var(--text-light);
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Efecto estrellas de fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><circle cx="100" cy="100" r="2" fill="%23ffd700" opacity="0.6"/><circle cx="300" cy="200" r="1.5" fill="%23ffd700" opacity="0.4"/><circle cx="500" cy="150" r="2" fill="%23ffd700" opacity="0.5"/><circle cx="700" cy="300" r="1" fill="%23ffd700" opacity="0.6"/><circle cx="900" cy="250" r="2" fill="%23ffd700" opacity="0.4"/><circle cx="1100" cy="150" r="1.5" fill="%23ffd700" opacity="0.5"/><circle cx="200" cy="400" r="1" fill="%23ffd700" opacity="0.4"/><circle cx="400" cy="500" r="2" fill="%23ffd700" opacity="0.5"/><circle cx="600" cy="600" r="1.5" fill="%23ffd700" opacity="0.6"/><circle cx="800" cy="550" r="1" fill="%23ffd700" opacity="0.4"/><circle cx="1000" cy="650" r="2" fill="%23ffd700" opacity="0.5"/></svg>') repeat;
    animation: twinkle 3s infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   HEADER
   ============================================ */

header {
    position: relative;
    z-index: 10;
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(244, 208, 63, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    padding: 2rem 0;
    text-align: center;
}

.logo-image {
    max-width: 400px;
    margin: 0 auto;
}

.logo-image img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(244, 208, 63, 0.3));
}

/* Navegación de secciones */
.nav-sections {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 1rem;
    background: rgba(45, 62, 80, 0.5);
    border-top: 1px solid rgba(244, 208, 63, 0.2);
}

.nav-sections a {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    text-decoration: none;
    padding: 12px 25px;
    background: rgba(26, 35, 50, 0.6);
    border: 2px solid var(--gold);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
}

.nav-sections a:hover,
.nav-sections a:focus {
    background: var(--gold);
    color: var(--navy-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(244, 208, 63, 0.4);
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

main {
    position: relative;
    z-index: 1;
    padding: 60px 0 80px;
}

section {
    padding: 80px 0;
    position: relative;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
    text-shadow: 0 5px 15px rgba(244, 208, 63, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-family: 'Lora', serif;
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(244, 208, 63, 0.4);
    text-decoration: none;
}

.btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(244, 208, 63, 0.6);
    color: var(--navy-dark);
}

/* ============================================
   TÍTULOS DE SECCIÓN
   ============================================ */

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 5px 15px rgba(244, 208, 63, 0.3);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
}

.section-subtitle {
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 4rem;
    opacity: 0.9;
}

/* Título de página para páginas específicas */
.page-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 5px 15px rgba(244, 208, 63, 0.3);
}

.page-description {
    text-align: center;
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   TARJETAS DE CUENTOS
   ============================================ */

.featured-section {
    background: rgba(26, 35, 50, 0.5);
}

.stories-container {
    position: relative;
    z-index: 1;
    padding: 40px 0;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.story-card {
    background: rgba(26, 35, 50, 0.8);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(244, 208, 63, 0.2);
    backdrop-filter: blur(10px);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(244, 208, 63, 0.3);
    border-color: var(--gold);
}

.story-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.story-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: var(--navy-medium);
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-card:hover .story-image img {
    transform: scale(1.1);
}

/* Badge de Ilustración Humana */
.human-art-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--human-badge) 0%, #27ae60 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(46, 204, 113, 0.5);
    }
    50% {
        box-shadow: 0 8px 30px rgba(46, 204, 113, 0.8);
    }
}

.human-art-badge i {
    font-size: 1rem;
}

.story-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.story-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.badge-original {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    box-shadow: 0 3px 10px rgba(244, 208, 63, 0.3);
}

.badge-clasico {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.badge-historico {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #138d75 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(22, 160, 133, 0.3);
}

.story-title {
    font-family: 'Cinzel', serif;
    font-size: 1.7rem;
    color: var(--gold);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

.story-excerpt {
    font-family: 'Lora', serif;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    opacity: 0.9;
}

.story-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(244, 208, 63, 0.2);
    font-size: 0.9rem;
}

.story-author,
.story-illustrator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(236, 240, 241, 0.7);
}

.story-author i,
.story-illustrator i {
    color: var(--gold);
}

.story-illustrator {
    color: var(--human-badge);
    font-weight: 600;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.3);
    margin-top: 1rem;
    align-self: flex-start;
}

.btn-read:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(244, 208, 63, 0.5);
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--gold);
}

.empty-state i {
    font-size: 5rem;
    opacity: 0.5;
    margin-bottom: 2rem;
}

.empty-state h3 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */

.stats-section {
    padding: 3rem 0;
    background: rgba(26, 35, 50, 0.4);
    border-top: 1px solid rgba(244, 208, 63, 0.2);
    border-bottom: 1px solid rgba(244, 208, 63, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: rgba(26, 35, 50, 0.6);
    border-radius: 15px;
    border: 2px solid rgba(244, 208, 63, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: 'Lora', serif;
    font-size: 1rem;
    color: var(--text-light);
    opacity: 0.9;
}

/* ============================================
   PAGINACIÓN
   ============================================ */

.pagination-container {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: rgba(26, 35, 50, 0.8);
    border: 2px solid rgba(244, 208, 63, 0.3);
    border-radius: 10px;
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pagination a:hover {
    background: var(--gold);
    color: var(--navy-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.4);
}

.pagination .active {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    border-color: var(--gold);
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.5);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .ellipsis {
    border: none;
    background: transparent;
    cursor: default;
}

/* ============================================
   HUMAN TOUCH SECTION
   ============================================ */

.human-section {
    background: linear-gradient(135deg, rgba(244, 208, 63, 0.15) 0%, rgba(255, 215, 0, 0.08) 100%);
    border-top: 2px solid rgba(244, 208, 63, 0.3);
    border-bottom: 2px solid rgba(244, 208, 63, 0.3);
    padding: 60px 0;
}

.human-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(244, 208, 63, 0.4);
}

.human-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.human-card {
    background: rgba(26, 35, 50, 0.8);
    border: 2px solid rgba(244, 208, 63, 0.3);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.human-card:hover {
    transform: translateY(-10px);
    border-color: var(--gold);
    box-shadow: 0 20px 40px rgba(244, 208, 63, 0.3);
}

.human-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
    display: block;
}

.human-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.human-card p {
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
}

.human-card .author-name {
    font-weight: 600;
    color: var(--gold-light);
    font-size: 1.1rem;
    margin-top: 1rem;
    display: block;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-all-stories {
    text-align: center;
    margin-top: 4rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 20px;
    color: var(--navy-dark);
}

.cta-all-stories h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-all-stories p {
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-stats {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.btn-final {
    background: var(--navy-dark);
    color: var(--gold);
    padding: 16px 45px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(26, 35, 50, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-final:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(26, 35, 50, 0.5);
    color: var(--gold);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    position: relative;
    z-index: 1;
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    text-align: center;
    padding: 3rem 2rem;
    border-top: 2px solid rgba(244, 208, 63, 0.3);
}

footer p {
    font-family: 'Lora', serif;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

footer p:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.footer-links a:hover {
    color: var(--gold-light);
    transform: scale(1.2);
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-dark);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(244, 208, 63, 0.4);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(244, 208, 63, 0.6);
}

/* ============================================
   ANIMACIONES
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero-title,
    .page-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle,
    .page-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .nav-sections {
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .nav-sections a {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .stories-grid,
    .human-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .story-image {
        height: 200px;
    }
    
    .human-art-badge {
        font-size: 0.65rem;
        padding: 6px 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .logo-image {
        max-width: 280px;
    }
    
    .header-content {
        padding: 1.5rem 0;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero-section {
        min-height: 50vh;
        padding: 60px 20px;
    }
    
    main {
        padding: 40px 0 60px;
    }
}