.stories-container {
    background: white;
    border-bottom: 1px solid #dbdbdb;
    padding: 15px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.stories-wrapper {
    display: inline-flex;
    gap: 15px;
    padding: 0 15px;
}

.story-item {
    display: inline-block;
    cursor: pointer;
    width: 150px;
}

.story-card {
    position: relative;
    width: 150px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f5f5f5;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.story-card img, .story-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.story-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #f97316;
    background: #f0f0f0;
}

.story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 8px;
    text-align: center;
    z-index: 1;
}

.story-title {
    display: block;
    font-size: 12px;
    font-weight: bold;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    max-height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-source {
    font-size: 10px;
    opacity: 0.8;
    display: block;
    margin-top: 2px;
}

.add-card {
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 2px dashed #ccc;
}

.add-card .story-media-placeholder {
    font-size: 40px;
    background: transparent;
}

/* Responsive: móviles */
@media (max-width: 640px) {
    .story-item {
        width: 120px;
    }
    .story-card {
        width: 120px;
        height: 160px;
    }
    .story-title {
        font-size: 10px;
        max-height: 28px;
    }
    .story-source {
        font-size: 8px;
    }
}

/* Para pantallas muy pequeñas (menos de 480px) */
@media (max-width: 480px) {
    .story-item {
        width: 100px;
    }
    .story-card {
        width: 100px;
        height: 140px;
    }
    .story-title {
        font-size: 9px;
    }
    .story-source {
        font-size: 7px;
    }
}

/* Estilos para el modal de subida (si se usa dentro del mismo CSS) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.close-button:hover {
    color: #000;
}

/* Dropzone para subir archivos */
#dropzone {
    transition: all 0.2s ease;
}

#dropzone.drag-over {
    background-color: #fff3e0;
    border-color: #f97316;
}

/* Vista previa de archivos */
#previewContainer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

#previewImage, #previewVideo {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
}