/**
 * Estilos Modernos para Sistema de Comentarios - Snowball
 * Diseño compacto, limpio y responsive
 */

/* ============================================================================
   SECCIÓN DE COMENTARIOS
   ============================================================================ */

.comentarios-seccion {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.comentarios-header {
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 15px;
}

.comentarios-header h6 {
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.comentarios-header i {
    margin-right: 8px;
    color: #6c757d;
}

.comentarios-count {
    font-weight: 700;
    color: #007bff;
}

/* ============================================================================
   LISTA DE COMENTARIOS
   ============================================================================ */

.comentarios-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================================
   COMENTARIO INDIVIDUAL
   ============================================================================ */

.comentario-item {
    background-color: white;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.comentario-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ============================================================================
   AVATAR CON INICIALES
   ============================================================================ */

.comentario-avatar {
    flex-shrink: 0;
}

.avatar-iniciales {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================================================
   CONTENIDO DEL COMENTARIO
   ============================================================================ */

.comentario-contenido {
    flex: 1;
    min-width: 0; /* Para que funcione text-overflow */
}

.comentario-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comentario-autor {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.comentario-fecha {
    font-size: 12px;
    color: #6c757d;
}

.comentario-fecha i {
    margin-right: 4px;
}

.comentario-texto {
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================================================
   ACCIONES DEL COMENTARIO
   ============================================================================ */

.comentario-acciones {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.btn-comentario-accion {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 12px;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-comentario-accion:hover {
    color: #007bff;
}

.btn-comentario-accion:focus {
    outline: none;
}

.btn-comentario-accion i {
    margin-right: 4px;
}

/* ============================================================================
   EMBEDS EN COMENTARIOS
   ============================================================================ */

.comentario-embed {
    margin-top: 10px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.embed-placeholder {
    position: relative;
    cursor: pointer;
    background-color: #000;
    overflow: hidden;
}

.embed-thumbnail {
    width: 100%;
    display: block;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.embed-placeholder:hover .embed-thumbnail {
    opacity: 1;
}

.embed-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.embed-placeholder:hover .embed-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.comentario-embed iframe {
    width: 100%;
    border: none;
}

/* ============================================================================
   IMÁGENES EN COMENTARIOS
   ============================================================================ */

.comentario-imagen {
    margin-top: 10px;
}

.comentario-imagen-thumb {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comentario-imagen-thumb:hover {
    transform: scale(1.02);
}

/* ============================================================================
   ARCHIVOS EN COMENTARIOS
   ============================================================================ */

.comentario-archivo {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.archivo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.archivo-link:hover {
    color: #0056b3;
    text-decoration: none;
}

.archivo-link i:first-child {
    font-size: 24px;
}

.archivo-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archivo-link i:last-child {
    font-size: 12px;
}

/* ============================================================================
   ENLACES EN COMENTARIOS
   ============================================================================ */

.comentario-link {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px dotted #007bff;
    transition: all 0.2s ease;
}

.comentario-link:hover {
    color: #0056b3;
    border-bottom-style: solid;
    text-decoration: none;
}

/* ============================================================================
   FOOTER DE COMENTARIOS
   ============================================================================ */

.comentarios-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.comentarios-footer .btn {
    font-size: 13px;
    font-weight: 500;
}

.comentarios-footer .btn i {
    margin-right: 6px;
}

/* ============================================================================
   FORMULARIO DE NUEVO COMENTARIO
   ============================================================================ */

.comentario-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.comentario-form textarea {
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.comentario-form textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* ============================================================================
   ESTADOS ESPECIALES
   ============================================================================ */

.comentario-item.editando {
    border: 2px solid #007bff;
}

.comentario-item.eliminando {
    opacity: 0.5;
    pointer-events: none;
}

.comentarios-lista.cargando {
    opacity: 0.6;
}

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

@media (max-width: 576px) {
    .comentario-item {
        flex-direction: column;
    }
    
    .comentario-avatar {
        align-self: flex-start;
    }
    
    .comentario-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .comentarios-seccion {
        padding: 10px;
    }
    
    .embed-play-button {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .comentario-acciones {
        flex-wrap: wrap;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comentario-item.nuevo {
    animation: fadeIn 0.3s ease;
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.comentario-vacio {
    text-align: center;
    padding: 30px;
    color: #6c757d;
}

.comentario-vacio i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #dee2e6;
}

.comentario-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}

.comentario-exito {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}
