/* 
 * Smiley Storytelling Images - CSS Optimizado
 * Branding: #ff0000 (rojo) + #33cc33 (verde)
 * Version: 2.0
 */

/* Base Styles */
.smiley-story-v1,
.smiley-story-v2 {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Aspect Ratios - REMOVER estas clases que interfieren */
.aspect-3-4 {
    /* Comentado - ya no se usa */
}

.aspect-9-16 {
    /* Comentado - ya no se usa */
}

/* ============================================
   VERSION 1: Single Image LinkedIn Style
   ============================================ */

.smiley-story-v1 {
    max-width: 500px;
    margin: 0 auto;
}

.smiley-story-v1 .story-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4 !important;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 4px solid #ffffff;
}

.smiley-story-v1 .story-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gradiente optimizado: solo 40% inferior */
.smiley-story-v1 .story-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.85) 0%, 
        rgba(0, 0, 0, 0.4) 30%,
        transparent 50%
    );
}

.smiley-story-v1 .story-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
}

.smiley-story-v1 .story-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.smiley-story-v1 .story-subtitle {
    font-size: 0.875rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.smiley-story-v1 .story-description {
    font-size: 0.75rem;
    opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Badge con branding Smiley */
.smiley-story-v1 .story-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #33cc33;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(51, 204, 51, 0.4);
}

/* ============================================
   VERSION 2: Timeline Story
   ============================================ */

.smiley-story-v2 {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border: 6px solid #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

/* Contenedor principal 3:4 (Portrait - LinkedIn style) */
.smiley-story-v2 .story-main-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4 !important;
    max-height: none;
    min-height: 400px;
    border-radius: 1rem;
    overflow: hidden;
    background: #1F2937;
    margin-bottom: 1rem;
}

.smiley-story-v2 .story-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.smiley-story-v2 .story-main-image.active {
    display: block !important;
    opacity: 1;
    z-index: 1;
}

/* Gradiente ELIMINADO - Imagen 100% visible */
.smiley-story-v2 .story-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.75) 0%, 
        rgba(0, 0, 0, 0.1) 15%,
        transparent 25%
    );
    pointer-events: none;
    z-index: 2;
}

.smiley-story-v2 .story-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.smiley-story-v2 .story-content.active {
    display: block !important;
}

.smiley-story-v2 .story-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.9),
        0 0 4px rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

.smiley-story-v2 .story-subtitle {
    font-size: 1rem;
    opacity: 0.98;
    margin-bottom: 0.5rem;
    text-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.9),
        0 0 3px rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

.smiley-story-v2 .story-description {
    font-size: 0.875rem;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.9),
        0 0 3px rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

.smiley-story-v2 .story-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.smiley-story-v2 .story-label {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.smiley-story-v2 .story-year {
    font-size: 1rem;
    opacity: 0.85;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Badge activo con branding */
.smiley-story-v2 .story-active-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #33cc33;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(51, 204, 51, 0.5);
    z-index: 4;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(51, 204, 51, 0.5);
    }
    50% {
        box-shadow: 0 4px 20px rgba(51, 204, 51, 0.8);
    }
}

/* ============================================
   THUMBNAILS - Cuadradas 1:1 (Instagram style)
   ============================================ */

.smiley-story-v2 .story-thumbnails {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0;
}

.smiley-story-v2 .story-thumbnail {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #f4f4f4;
}

/* Hover state con rojo */
.smiley-story-v2 .story-thumbnail:hover {
    transform: scale(1.08);
    border-color: #ff0000;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.4);
}

/* Hover tooltip */
.smiley-story-v2 .story-thumbnail:hover::after {
    content: "Ampliar";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Active state con verde */
.smiley-story-v2 .story-thumbnail.active {
    transform: scale(1.1);
    border: 4px solid #33cc33;
    box-shadow: 0 10px 30px rgba(51, 204, 51, 0.6);
}

/* No mostrar tooltip en active */
.smiley-story-v2 .story-thumbnail.active:hover::after {
    display: none;
}

.smiley-story-v2 .story-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay de thumbnails: gradiente más suave, solo bottom 40% */
.smiley-story-v2 .thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(0, 0, 0, 0.2) 35%,
        transparent 50%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.smiley-story-v2 .story-thumbnail:hover .thumbnail-overlay {
    opacity: 0;
}

.smiley-story-v2 .thumbnail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.smiley-story-v2 .thumbnail-label {
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.smiley-story-v2 .thumbnail-year {
    color: white;
    opacity: 0.9;
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Indicador activo en thumbnail */
.smiley-story-v2 .story-thumbnail.active .thumbnail-overlay {
    background: linear-gradient(
        to top, 
        rgba(51, 204, 51, 0.95) 0%, 
        rgba(51, 204, 51, 0.4) 50%,
        transparent 70%
    );
}

/* ============================================
   HELPER TEXT - "Selecciona una imagen..."
   SIEMPRE VISIBLE (no solo en hover)
   ============================================ */

.smiley-story-v2 .story-helper-text {
    text-align: center;
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-style: italic;
    opacity: 1;
    transition: color 0.3s ease;
}

/* Cambiar color al hover del contenedor (feedback visual sutil) */
.smiley-story-v2:hover .story-helper-text {
    color: #ff0000;
}

/* ============================================
   INFO CARD - ELIMINADA
   (Espacio recuperado para thumbnails)
   ============================================ */

/* Si decides mantenerla, aquí está optimizada: */
.smiley-story-v2 .story-info-card {
    background: #f4f4f4;
    border: 2px solid #33cc33;
    border-radius: 0.75rem;
    padding: 1rem;
    display: none; /* Oculta por defecto */
    gap: 0.75rem;
}

/* Mostrar solo si se agrega clase .show-info */
.smiley-story-v2.show-info .story-info-card {
    display: flex;
}

.smiley-story-v2 .info-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #33cc33;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.smiley-story-v2 .info-content h3 {
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.smiley-story-v2 .info-content p {
    color: #4B5563;
    font-size: 0.75rem;
    line-height: 1.5;
}

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

@media (max-width: 768px) {
    .smiley-story-v2 {
        max-width: 100%;
        padding: 0.75rem;
        border-width: 4px;
    }
    
    .smiley-story-v2 .story-main-container {
        aspect-ratio: 3 / 4 !important;
        min-height: 350px;
    }
    
    .smiley-story-v2 .story-title {
        font-size: 1.5rem;
    }
    
    .smiley-story-v2 .story-label {
        font-size: 1.25rem;
    }
    
    .smiley-story-v2 .thumbnail-label {
        font-size: 0.75rem;
    }
    
    .smiley-story-v2 .story-thumbnails {
        gap: 0.75rem;
    }
    
    /* Helper text más visible en mobile */
    .smiley-story-v2 .story-helper-text {
        font-size: 0.8125rem;
        font-weight: 500;
    }
}

@media (max-width: 480px) {
    .smiley-story-v2 .story-main-container {
        aspect-ratio: 3 / 4 !important;
        min-height: 300px;
    }
    
    .smiley-story-v2 .story-content {
        padding: 1rem;
    }
    
    .smiley-story-v2 .story-title {
        font-size: 1.25rem;
    }
    
    .smiley-story-v2 {
        padding: 0.5rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states para keyboard navigation */
.smiley-story-v2 .story-thumbnail:focus {
    outline: 3px solid #ff0000;
    outline-offset: 2px;
}

/* Animaciones reducidas para usuarios con preferencias */
@media (prefers-reduced-motion: reduce) {
    .smiley-story-v2 .story-main-image,
    .smiley-story-v2 .story-content,
    .smiley-story-v2 .story-thumbnail {
        transition: none;
    }
    
    .smiley-story-v2 .story-active-badge {
        animation: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Ocultar info card por defecto */
.hide-info-card .story-info-card {
    display: none !important;
}

/* Mostrar borde solo en versión single */
.story-bordered .story-main-container {
    border-width: 6px;
}

/* Variante sin gradiente (para testing) */
.no-gradient .story-overlay {
    background: none;
}

.no-gradient .thumbnail-overlay {
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.6) 0%, 
        transparent 60%
    );
}