/**
 * Componentes específicos para mensajes y elementos interactivos
 * assets/css/components.css
 */

/* Estilos específicos para la columna de mensajes */
.messages-column {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

/* Header de la sección de mensajes */
.messages-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f4;
}

.messages-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.messages-stats {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Estados especiales de mensajes */
.message-item.unread {
    background: #fffbf0;
    border-left-color: #f6ad55;
}

.message-item.private {
    background: #faf5ff;
    border-left-color: #b794f6;
}

.message-item.system {
    background: #f0f4f7;
    border-left-color: #718096;
    font-style: italic;
}

/* Indicadores de tipo de mensaje */
.message-item.incoming::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 8px;
    width: 3px;
    height: 20px;
    background: #4299e1;
    border-radius: 0 2px 2px 0;
}

.message-item.outgoing::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 8px;
    width: 3px;
    height: 20px;
    background: #38a169;
    border-radius: 0 2px 2px 0;
}

/* Animaciones para mensajes */
.message-item {
    animation: slideInMessage 0.3s ease-out;
}

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

/* Efectos hover mejorados */
.message-item:hover .message-time {
    color: var(--text-secondary);
}

.message-item:hover .message-sender {
    color: var(--text-primary);
}

/* Loading state para mensajes */
.messages-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 12px;
}

.messages-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Mejoras de accesibilidad */
.message-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Truncate para mensajes muy largos */
.message-content.truncated {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.message-content.truncated::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: inherit;
    padding-left: 8px;
}

/* Estilos para diferentes tipos de contenido */
.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

.message-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 2px;
    font-family: monospace;
    font-size: 11px;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 11px;
    margin: 4px 0;
}

/* Botones especiales */
.btn-success {
    background: var(--success-color);
    color: #ffffff;
    border-color: var(--success-color);
}

.btn-success:hover {
    background: #2f855a;
    border-color: #2f855a;
}

.btn-warning {
    background: var(--warning-color);
    color: #ffffff;
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background: #dd6b20;
    border-color: #dd6b20;
}

.btn-danger {
    background: var(--error-color);
    color: #ffffff;
    border-color: var(--error-color);
}

.btn-danger:hover {
    background: #c53030;
    border-color: #c53030;
}

/* Estados de botones */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    background: #ffffff;
    border-color: var(--border);
    color: var(--text-primary);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Badges y etiquetas */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    background: var(--bg-light);
    color: var(--text-secondary);
}

.badge-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.badge-success {
    background: var(--success-color);
    color: #ffffff;
}

.badge-warning {
    background: var(--warning-color);
    color: #ffffff;
}

.badge-danger {
    background: var(--error-color);
    color: #ffffff;
}

/* Tooltips simples */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Responsive específico para componentes */
@media (max-width: 768px) {
    .messages-column {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 16px;
        margin-top: 16px;
    }
    
    .message-item.outgoing {
        margin-left: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .badge {
        font-size: 9px;
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .message-item {
        padding: 6px 8px;
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .message-time {
        font-size: 9px;
    }
    
    .message-item.outgoing {
        margin-left: 4px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Utilidades adicionales */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Estados de carga para elementos específicos */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Transiciones suaves */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Badges y etiquetas */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    background: var(--bg-light);
    color: var(--text-secondary);
    min-width: 16px;
    text-align: center;
}

.badge-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.badge-success {
    background: var(--success-color);
    color: #ffffff;
}

.badge-warning {
    background: var(--warning-color);
    color: #ffffff;
}

.badge-danger {
    background: var(--error-color);
    color: #ffffff;
}

/**
 * Estilos para contenido multimedia en mensajes
 * Agregar al final de assets/css/components.css
 */

/* Contenedores para diferentes tipos de contenido */
.message-image,
.message-audio,
.message-video,
.message-file,
.message-location,
.message-contact,
.message-sticker,
.message-link-generic,
.message-unknown {
    margin: 4px 0;
}

/* Imágenes en mensajes */
.message-image {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-thumbnail {
    max-width: 120px;
    max-height: 80px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    object-fit: cover;
}

.message-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Enlaces de archivos */
.message-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

.message-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.message-link a:hover {
    text-decoration: underline;
}

.link-url {
    color: var(--text-muted);
    font-size: 10px;
    word-break: break-all;
    font-family: monospace;
}

/* Audio en mensajes */
.message-audio {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-audio-player {
    width: 200px;
    height: 30px;
    border-radius: 4px;
}

/* Video en mensajes */
.message-video {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-video-player {
    max-width: 250px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Archivos genéricos */
.message-file {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    background: var(--bg-light);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-name {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    word-break: break-word;
}

.file-name:hover {
    text-decoration: underline;
}

/* Ubicaciones */
.message-location {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #e6f3ff;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}

.location-icon {
    font-size: 14px;
    color: #2196f3;
}

.location-details {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Contactos */
.message-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f0f8ff;
    border-radius: 4px;
    border-left: 3px solid #4a90e2;
}

.contact-icon {
    font-size: 14px;
    color: #4a90e2;
}

.contact-details {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Stickers */
.message-sticker {
    display: flex;
    justify-content: flex-start;
}

.sticker-image {
    max-width: 100px;
    max-height: 100px;
    cursor: pointer;
    transition: var(--transition);
}

.sticker-image:hover {
    transform: scale(1.1);
}

/* Enlaces genéricos */
.message-link-generic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    background: var(--bg-light);
    border-radius: 3px;
    border-left: 2px solid var(--primary-color);
}

.message-link-generic a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.message-link-generic a:hover {
    text-decoration: underline;
}

/* Contenido desconocido */
.message-unknown {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #fff3cd;
    border-radius: 3px;
    border-left: 2px solid #ffc107;
    font-size: 11px;
    color: #856404;
}

.unknown-icon {
    font-size: 12px;
}

/* Placeholders para contenido no disponible */
.message-placeholder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: #f8f9fa;
    border-radius: 3px;
    border-left: 2px solid #dee2e6;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Efectos hover para elementos interactivos */
.message-image:hover,
.message-audio:hover,
.message-video:hover,
.message-file:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    padding: 2px;
    margin: 2px -2px;
}

/* Responsive para multimedia */
@media (max-width: 768px) {
    .message-thumbnail {
        max-width: 100px;
        max-height: 60px;
    }
    
    .message-audio-player {
        width: 150px;
        height: 25px;
    }
    
    .message-video-player {
        max-width: 200px;
        max-height: 120px;
    }
    
    .file-info {
        gap: 6px;
    }
    
    .file-icon {
        font-size: 14px;
    }
    
    .sticker-image {
        max-width: 80px;
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .message-thumbnail {
        max-width: 80px;
        max-height: 50px;
    }
    
    .message-audio-player {
        width: 120px;
        height: 20px;
    }
    
    .message-video-player {
        max-width: 150px;
        max-height: 90px;
    }
    
    .message-link a,
    .file-name {
        font-size: 11px;
    }
    
    .link-url {
        font-size: 9px;
    }
    
    .sticker-image {
        max-width: 60px;
        max-height: 60px;
    }
}

/* Animaciones específicas para multimedia */
@keyframes imageLoad {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-thumbnail,
.sticker-image {
    animation: imageLoad 0.3s ease-out;
}

/* Estados de carga para multimedia */
.media-loading {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.media-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error en carga de multimedia */
.media-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #fed7d7;
    border-radius: 4px;
    font-size: 11px;
    color: #9b2c2c;
    border-left: 2px solid var(--error-color);
}

/* Botones de acción para multimedia */
.media-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.media-btn {
    padding: 2px 6px;
    font-size: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition);
}

.media-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Indicadores de tipo de archivo en los mensajes */
.message-item[data-content-type="image"] .message-header::after {
    content: '🖼️';
    margin-left: 4px;
    opacity: 0.6;
    font-size: 10px;
}

.message-item[data-content-type="audio"] .message-header::after {
    content: '🎵';
    margin-left: 4px;
    opacity: 0.6;
    font-size: 10px;
}

.message-item[data-content-type="video"] .message-header::after {
    content: '🎥';
    margin-left: 4px;
    opacity: 0.6;
    font-size: 10px;
}

.message-item[data-content-type="file"] .message-header::after,
.message-item[data-content-type="document"] .message-header::after {
    content: '📎';
    margin-left: 4px;
    opacity: 0.6;
    font-size: 10px;
}

/**
 * ESTILOS MEJORADOS PARA MULTIMEDIA - AGREGAR AL FINAL DE assets/css/components.css
 * Estos estilos complementan los existentes y mejoran la visualización de archivos
 */

/* Mejoras para imágenes */
.message-image {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid #e2e8f0;
}

.message-thumbnail {
    max-width: 140px;
    max-height: 100px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4a5568;
}

/* Enlaces mejorados */
.message-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    padding: 2px 0;
}

.message-link a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.message-link a:hover {
    color: #2d3748;
    text-decoration: underline;
}

.link-url {
    color: #718096;
    font-size: 10px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 2px 4px;
    border-radius: 3px;
    margin-top: 2px;
}

/* Archivos genéricos mejorados */
.message-file {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    background: #f7fafc;
    transition: all 0.2s ease;
}

.message-file:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.file-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.file-name {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    word-break: break-word;
    line-height: 1.3;
}

.file-name:hover {
    color: #2d3748;
    text-decoration: underline;
}

/* Acciones de archivo */
.file-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.media-btn {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid #cbd5e0;
    background: #ffffff;
    color: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.media-btn:hover {
    background: #4a5568;
    color: #ffffff;
    border-color: #4a5568;
    transform: translateY(-1px);
}

/* Audio mejorado */
.message-audio {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #4299e1;
}

.message-audio-player {
    width: 100%;
    max-width: 220px;
    height: 35px;
    border-radius: 6px;
    outline: none;
}

.message-audio-player:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Video mejorado */
.message-video {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #fffaf0;
    border-radius: 6px;
    border-left: 4px solid #ed8936;
}

.message-video-player {
    max-width: 280px;
    max-height: 180px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #000000;
}

/* Ubicaciones mejoradas */
.message-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: #e6fffa;
    border-radius: 6px;
    border-left: 4px solid #38b2ac;
}

.location-icon {
    font-size: 16px;
    color: #38b2ac;
    margin-top: 2px;
}

.location-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.location-details {
    font-size: 12px;
    color: #2d3748;
    line-height: 1.4;
}

/* Contactos mejorados */
.message-contact {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #4299e1;
}

.contact-icon {
    font-size: 16px;
    color: #4299e1;
    margin-top: 2px;
}

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.contact-details {
    font-size: 12px;
    color: #2d3748;
    line-height: 1.4;
}

/* Stickers mejorados */
.message-sticker {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.sticker-image {
    max-width: 120px;
    max-height: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticker-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Enlaces genéricos mejorados */
.message-link-generic {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #4a5568;
    border: 1px solid #e2e8f0;
}

.generic-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.generic-icon {
    font-size: 16px;
    color: #4a5568;
}

.generic-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.generic-details a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

.generic-details a:hover {
    color: #2d3748;
    text-decoration: underline;
}

.content-type-label {
    font-size: 10px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Contenido desconocido mejorado */
.message-unknown {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    background: #fffbf0;
    border-radius: 6px;
    border-left: 3px solid #ed8936;
    border: 1px solid #fbd38d;
}

.unknown-icon {
    font-size: 14px;
    color: #ed8936;
    margin-top: 2px;
}

.unknown-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.unknown-type {
    font-size: 11px;
    color: #744210;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unknown-details {
    font-size: 12px;
    color: #2d3748;
    word-break: break-word;
}

/* Estados de error */
.image-error,
.sticker-error {
    display: none;
    padding: 6px 8px;
    background: #fed7d7;
    border-radius: 4px;
    color: #9b2c2c;
    font-size: 11px;
    border: 1px solid #feb2b2;
    margin-top: 4px;
}

/* Placeholders mejorados */
.message-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* Efectos hover generales para multimedia */
.message-image:hover,
.message-audio:hover,
.message-video:hover,
.message-link-generic:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive específico para multimedia */
@media (max-width: 768px) {
    .message-thumbnail {
        max-width: 120px;
        max-height: 80px;
    }
    
    .message-audio-player {
        max-width: 180px;
        height: 30px;
    }
    
    .message-video-player {
        max-width: 240px;
        max-height: 140px;
    }
    
    .file-info {
        gap: 8px;
    }
    
    .file-icon {
        font-size: 16px;
    }
    
    .sticker-image {
        max-width: 100px;
        max-height: 100px;
    }
    
    .media-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .message-thumbnail {
        max-width: 100px;
        max-height: 60px;
    }
    
    .message-audio-player {
        max-width: 150px;
        height: 25px;
    }
    
    .message-video-player {
        max-width: 180px;
        max-height: 100px;
    }
    
    .file-name {
        font-size: 12px;
    }
    
    .link-url {
        font-size: 9px;
    }
    
    .sticker-image {
        max-width: 80px;
        max-height: 80px;
    }
    
    .message-link a,
    .file-name {
        font-size: 11px;
    }
}

/* Animaciones específicas */
@keyframes mediaLoad {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message-image,
.message-audio,
.message-video,
.message-file,
.message-sticker {
    animation: mediaLoad 0.3s ease-out;
}

/* Efectos de carga */
.media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 11px;
    color: #718096;
}

.media-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #4a5568;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Estados de selección mejorados */
.message-item.selected .message-image,
.message-item.selected .message-audio,
.message-item.selected .message-video,
.message-item.selected .message-file {
    background: #e6f3ff;
    border-color: #4299e1;
}

.message-item.selected .message-link a {
    color: #2b6cb0;
    font-weight: 700;
}

/* Indicadores de tipo de archivo más visibles */
.message-item[data-content-type="image"] .message-header::after {
    content: '🖼️';
    margin-left: 6px;
    opacity: 0.8;
    font-size: 11px;
}

.message-item[data-content-type="audio"] .message-header::after {
    content: '🎵';
    margin-left: 6px;
    opacity: 0.8;
    font-size: 11px;
}

.message-item[data-content-type="video"] .message-header::after {
    content: '🎥';
    margin-left: 6px;
    opacity: 0.8;
    font-size: 11px;
}

.message-item[data-content-type="file"] .message-header::after,
.message-item[data-content-type="document"] .message-header::after {
    content: '📎';
    margin-left: 6px;
    opacity: 0.8;
    font-size: 11px;
}
/* Estilos para el selector de prioridad del ticket */
.ticket-priority-section {
    margin-top: 12px;
    margin-bottom: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.priority-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.priority-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.priority-option {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.priority-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.priority-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.priority-option input[type="radio"]:checked + .priority-badge {
    box-shadow: 0 0 0 2px var(--primary-color);
    transform: translateY(-1px);
}

.priority-option input[type="radio"]:focus + .priority-badge {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.priority-badge.low {
    background: #e8f5e8;
    color: #2e7d32;
}

.priority-badge.normal {
    background: #e3f2fd;
    color: #1976d2;
}

.priority-badge.high {
    background: #fff3e0;
    color: #f57c00;
}

.priority-badge.urgent {
    background: #ffebee;
    color: #d32f2f;
}

.priority-option:hover .priority-badge {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

/* Estilos para los attachments en el ticket */
.attachment-preview {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-thumbnail {
    position: relative;
    width: 64px;
    height: 64px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-thumbnail .attachment-type {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
}

.attachment-count {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Spinner para la creación de ticket */
.creating-ticket-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Botón de crear ticket - más visible y llamativo */
.btn-create-ticket {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #714b67 0%, #8b5a6b 100%);
    color: #ffffff;
    border: 1px solid #714b67;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(113, 75, 103, 0.3);
    width: 100%;
    margin-top: 8px;
}

.btn-create-ticket:hover {
    background: linear-gradient(135deg, #5a3a52 0%, #6d4a56 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(113, 75, 103, 0.4);
}

.btn-create-ticket:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(113, 75, 103, 0.3);
}

.btn-create-ticket:disabled {
    background: #cbd5e0;
    border-color: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estilos para la sección de título del ticket */
.ticket-title-section {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.title-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    display: block;
}

.ticket-title-input {
    width: calc(100% - 40px);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-primary);
    background: #ffffff;
    transition: var(--transition);
    font-family: inherit;
    margin-right: 8px;
}

.ticket-title-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
    background: #fefefe;
}

.ticket-title-input:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.ticket-title-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.8;
}

.btn-regenerate-title {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    vertical-align: top;
    margin-top: 0;
}

.btn-regenerate-title:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(74, 85, 104, 0.2);
}

.btn-regenerate-title:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(74, 85, 104, 0.2);
}

.btn-regenerate-title:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Animación de regeneración */
.btn-regenerate-title.regenerating {
    animation: rotateTitle 1s linear infinite;
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

@keyframes rotateTitle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estados visuales para el input del título */
.ticket-title-input.generated {
    border-color: #38a169;
    background: #f0fff4;
}

.ticket-title-input.edited {
    border-color: #ed8936;
    background: #fffaf0;
}

.ticket-title-input.error {
    border-color: #e53e3e;
    background: #fed7d7;
}

/* Responsive para la sección de título */
@media (max-width: 768px) {
    .ticket-title-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .ticket-title-input {
        width: calc(100% - 36px);
        padding: 6px 10px;
        font-size: 12px;
        margin-right: 6px;
    }
    
    .btn-regenerate-title {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ticket-title-section {
        padding: 8px;
    }
    
    .ticket-title-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .btn-regenerate-title {
        width: 100%;
        height: 32px;
        border-radius: 4px;
        margin-top: 0;
    }
}

/* Tooltip para el botón de regenerar */
.btn-regenerate-title[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 5px;
}