/* ============================================
   WEB STORIES - Estilo TikTok
   Videos cortos para ConstruDepot
   ============================================ */

.web-stories-section {
    padding: var(--space-3xl) 0;
    background: var(--gray-50);
    overflow: hidden;
}

.web-stories-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.web-stories-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
}

.web-stories-subtitle {
    font-size: 16px;
    color: var(--gray-500);
}

.web-stories-title .tiktok-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--gray-300);
    border-radius: 25px;
    margin-left: 16px;
    vertical-align: middle;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: 0.3px;
}

.web-stories-title .tiktok-link::after {
    content: 'Síguenos';
    font-family: var(--font-body);
}

.web-stories-title .tiktok-link i {
    font-size: 16px;
    background: linear-gradient(135deg, #25F4EE 0%, #FE2C55 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.web-stories-title .tiktok-link:hover {
    background: linear-gradient(135deg, #000000 0%, #121212 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.web-stories-title .tiktok-link:hover i {
    -webkit-text-fill-color: white;
    background: none;
}

.web-stories-title .tiktok-link:hover::after {
    color: white;
}

@media (max-width: 576px) {
    .web-stories-title .tiktok-link {
        padding: 6px 12px;
        margin-left: 10px;
        font-size: 12px;
    }

    .web-stories-title .tiktok-link::after {
        content: '';
    }

    .web-stories-title .tiktok-link i {
        font-size: 14px;
    }
}

.web-stories-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-2xl);
}

.web-stories-scroll {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: var(--space-md) 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-orange) var(--gray-200);
}

/* Cuando hay pocos videos, centrarlos */
@media (min-width: 1400px) {
    .web-stories-scroll {
        justify-content: center;
    }
}

.web-stories-scroll::-webkit-scrollbar {
    height: 8px;
}

.web-stories-scroll::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 10px;
}

.web-stories-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 10px;
}

.web-stories-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Story Card */
.story-card {
    flex: 0 0 auto;
    width: 200px;
    height: 355px;
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    background: #000;
}

.story-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.story-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* Video en la card */
.story-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay gradient */
.story-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: white;
    pointer-events: none;
}

.story-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-description {
    font-size: 12px;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icono de play */
.story-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.story-card:hover .story-play-icon {
    opacity: 1;
}

.story-play-icon i {
    color: white;
    font-size: 24px;
    margin-left: 3px;
}

/* Badge de duración */
.story-duration {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* ============================================
   MODAL DE VIDEO EXPANDIDO
   ============================================ */

.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

.story-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.story-modal-content {
    position: relative;
    max-width: 500px;
    width: 100%;
    height: 90vh;
    max-height: 888px;
    background: #000;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.story-modal-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Botón de cerrar */
.story-modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.story-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Info del video en modal */
.story-modal-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-xl);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: white;
    z-index: 10;
}

.story-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.story-modal-description {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.story-modal-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--gradient-orange);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.story-modal-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange);
    color: white;
    text-decoration: none;
}

/* Controles de navegación */
.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.story-nav-prev {
    left: var(--space-lg);
}

.story-nav-next {
    right: var(--space-lg);
}

.story-nav-btn {
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.story-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.story-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Contador de vistas */
.story-views {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.story-views i {
    font-size: 12px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .web-stories-title {
        font-size: 26px;
    }

    .web-stories-subtitle {
        font-size: 14px;
    }

    .story-card {
        width: 160px;
        height: 284px;
    }

    .story-title {
        font-size: 13px;
    }

    .story-description {
        font-size: 11px;
    }

    .story-modal-content {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .story-modal {
        padding: 0;
    }

    .story-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .story-card {
        width: 140px;
        height: 248px;
    }

    .web-stories-scroll {
        gap: var(--space-md);
    }

    .story-modal-info {
        padding: var(--space-lg);
    }

    .story-modal-title {
        font-size: 16px;
    }

    .story-modal-description {
        font-size: 13px;
    }
}

/* Loading skeleton */
.story-skeleton {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-2xl);
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    transition: opacity 0.3s ease;
}

/* Ocultar skeleton cuando el video está cargado */
.story-video[src] ~ .story-skeleton,
.story-video.loaded ~ .story-skeleton {
    opacity: 0;
    pointer-events: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

