/* Storytelling Section - Carrusel Horizontal (Dark Purple Theme) */

.storytelling {
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
    /* Tono Morado Oscuro elegante */
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e293b 100%);
    color: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Decoración de fondo galáctica sutil */
.storytelling::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.storytelling::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.storytelling-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Contenedor del Carrusel */
.story-cards-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    
    /* Alineación para mostrar la primera tarjeta */
    justify-content: flex-start;
    
    /* Padding para breathing room */
    padding: 1.5rem 5% 2rem 5%;
    
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    /* Scrollbar sutil */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.story-cards-container::-webkit-scrollbar {
    height: 6px;
}

.story-cards-container::-webkit-scrollbar-track {
    background: transparent;
}

.story-cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.story-cards-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* TARJETA INDIVIDUAL - Glassmorphism mejorado */
.story-card {
    flex: 0 0 320px; /* Ancho más generoso */
    min-width: 320px;
    max-width: 320px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    
    /* Estilo Glass premium */
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect mejorado */
.story-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.4);
}

.story-card.card-1 { animation-delay: 0.1s; }
.story-card.card-2 { animation-delay: 0.2s; }
.story-card.card-3 { animation-delay: 0.3s; }
.story-card.card-4 { animation-delay: 0.4s; }
.story-card.card-5 { animation-delay: 0.5s; }


/* Hover Effect */
.story-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px) !important; /* Override animación */
}

/* Contenido Interno */
.card-emoji {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
    display: block;
}

.story-card h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-family: 'Inter', sans-serif;
}

.card-detail {
    color: #c7d2fe; /* Indigo muy claro */
    font-size: 1.05rem;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}


/* Tarjetas Especiales - Brillan un poco más */

/* Warning (Amarilla) */
.story-card.warning-card {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow: 0 8px 32px 0 rgba(251, 191, 36, 0.15);
}
.story-card.warning-card h3 { 
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}
.story-card.warning-card:hover {
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 16px 48px 0 rgba(251, 191, 36, 0.25);
}

/* Solution (Verde) */
.story-card.solution-card {
    border-color: rgba(52, 211, 153, 0.5);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.15); 
}
.story-card.solution-card h3 { 
    color: #34d399;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}
.story-card.solution-card:hover {
    border-color: rgba(52, 211, 153, 0.7);
    box-shadow: 0 16px 48px 0 rgba(16, 185, 129, 0.25);
}


/* Contexto inferior */
.story-context {
    text-align: center;
    color: #a5b4fc; /* Indigo light text */
    max-width: 650px;
    margin: 1rem auto 0;
    padding: 0 2rem;
    font-size: 1.1rem;
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}
.story-context strong {
    color: white;
    display: block;
    margin-top: 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
}


/* Título superior del storytelling */
.storytelling-title {
    text-align: center;
    color: #ffffff;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

.storytelling-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Título en medio (entre carrusel y contexto) */
.storytelling-title-middle {
    text-align: center;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    margin: 2.5rem 0 2rem 0;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

.storytelling-title-middle::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Responsive */
@media (min-width: 768px) {
    .story-cards-container {
        padding-left: 8%;
        padding-right: 8%;
    }
}

@media (max-width: 767px) {
    .storytelling {
        padding: 3rem 0;
        min-height: auto;
    }
    
    .story-cards-container {
        padding: 1.5rem 1rem 2rem 1rem;
        gap: 1rem;
    }
    
    .story-card {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
        padding: 2rem 1.5rem;
    }
    
    .card-emoji {
        font-size: 3rem;
    }
    
    .story-card h3 {
        font-size: 1.2rem;
    }
    
    .card-detail {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .story-context {
        font-size: 0.95rem;
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .story-context strong {
        font-size: 1.05rem;
    }
    
    .storytelling-title {
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    .storytelling-title-middle {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem 0;
        padding: 0 1rem;
    }
}
