/* ================== Sistema Modular de Comentarios Zikpic ================== */
/* Archivo dedicado para comentarios - Uso modular en toda la aplicación */

:root {
    --zikpic-green: #81d742;
    --zikpic-dark-green: #6bb536;
    --zikpic-light-green: #9de45a;
    --comment-bg: #ffffff;
    --comment-border: #e0e1e3;
    --comment-text: #2E3440;
    --comment-text-light: #5E6E6D;
    --comment-shadow: 0 2px 8px rgba(224, 225, 227, 0.6);
}

/* ================== Contenedor principal de comentarios ================== */
.comments-section {
    width: 100%;
    max-width: 100%;
    background: transparent;
}

.comments-section.expanded {
    /* Siempre expandido en modal de galería */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comments-section.collapsed .comments-content {
    display: none;
}

/* ================== Header de comentarios con filtros ================== */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.comments-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--comment-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    background: var(--zikpic-green);
    color: white;
    font-size: 0.85rem;
    font-weight: 400;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.griscount {
    background: none;
    color: #999;
}

.comments-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-sort {
    background: var(--comment-bg);
    border: 1px solid var(--comment-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: var(--comment-text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.comment-sort:hover,
.comment-sort:focus {
    border-color: var(--zikpic-green);
}

/* ================== Composer de comentarios ================== */
.comment-composer {
    background: var(--comment-bg);
    /* border-radius: 16px; */
    /* box-shadow: var(--comment-shadow); */
    padding: 18px;
    margin-bottom: 20px;
    /* border: 1px solid var(--comment-border); */
    flex-shrink: 0; /* En modal de galería, el composer no se comprime */
}

.comment-input {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--comment-border);
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 12px;
    background: #fafbfc;
}

.comment-input:focus {
    border-color: var(--zikpic-green);
    box-shadow: 0 0 0 3px rgba(129, 215, 66, 0.1);
    background: var(--comment-bg);
}

.comment-input::placeholder {
    color: var(--comment-text-light);
}

.comment-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    background: none;
    border: none;
    color: var(--comment-text-light);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    z-index: 100;
    position: relative; /* Asegurar que respete z-index */
}

.tool-btn:hover {
    background: #f1f3f6;
    color: var(--zikpic-green);
    transform: scale(1.05);
    z-index: inherit; /* Mantener el z-index heredado */
}

.comment-send-btn {
    background: var(--zikpic-green);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-send-btn:hover {
    background: var(--zikpic-dark-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 215, 66, 0.3);
}

.comment-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ================== Lista de comentarios ================== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.comment-item {
    background: var(--comment-bg);
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(224, 225, 227, 0.4);
    padding: 16px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
   /*  position: relative; */
}

/* Optimización para modal de galería - comentarios más compactos */
.modal-comments-section .comment-item {
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(224, 225, 227, 0.3);
}

.modal-comments-section .comment-item:hover {
    border-left-color: var(--zikpic-light-green);
    box-shadow: 0 2px 8px rgba(224, 225, 227, 0.4);
}

.comment-item:hover {
    border-left-color: var(--zikpic-light-green);
    box-shadow: 0 4px 12px rgba(224, 225, 227, 0.5);
}

/* Ya se define arriba para modal - eliminar esta regla duplicada */

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--zikpic-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-user-info {
    flex: 1;
}

.comment-user {
    font-weight: 600;
    color: var(--comment-text);
    font-size: 0.95rem;
    margin-bottom: -5px;
}

.comment-date {
    color: var(--comment-text-light);
    font-size: 0.75rem;
}

.comment-content {
    font-size: 1rem;
    color: var(--comment-text);
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 6px;
    padding-left: 6px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--comment-text-light);
}

.comment-action {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.comment-action:hover {
    color: var(--zikpic-green);
    background: rgba(129, 215, 66, 0.1);
    transform: translateY(-1px);
}

.comment-action.liked {
    color: #e74c3c;
    animation: likeAnimation 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-action.liked i {
    animation: heartBeat 0.6s ease-in-out;
}

/* Animación suave para el like */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Animación del corazón */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Transición suave para cambio de ícono */
.comment-action i {
    transition: all 0.2s ease;
    display: inline-block;
}

/* Estados de loading/disabled */
.comment-action[style*="pointer-events: none"] {
    opacity: 0.7 !important;
    cursor: not-allowed;
}

/* Efecto ripple al hacer clic */
.comment-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(129, 215, 66, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.comment-action:active::before {
    width: 120%;
    height: 120%;
}

/* ================== Elementos multimedia en comentarios ================== */
.comment-gif {
    max-width: 200px;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-gif:hover {
    transform: scale(1.02);
}

.comment-sticker {
    max-width: 80px;
    margin: 6px 0;
}

.comment-spoiler {
    background: #eee;
    color: #eee;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.comment-spoiler.revealed {
    color: var(--comment-text);
    background: rgba(129, 215, 66, 0.1);
}

/* ================== Estados de carga y error ================== */
.comments-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--comment-text-light);
}

.comments-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: #dc2626;
    font-size: 0.9rem;
    margin: 16px 0;
}

.comments-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--comment-text-light);
}

.comments-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--comment-border);
}

.comments-empty h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--comment-text);
}

/* ================== Estilos específicos para modal de galería ================== */
.modal-comments-section {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important; /* ✅ Permitir scroll natural */
    max-height: none !important; /* ✅ Sin límites de altura */
    box-sizing: border-box !important;
}

.modal-comments-section .comments-header {
    margin-bottom: 4px !important;
    padding: 8px 16px 4px 16px !important;
    flex-shrink: 0; /* ✅ No comprimir header */
}

.modal-comments-section .comment-composer {
    margin: 0 !important;
    padding: 8px 16px !important;
    flex-shrink: 0; /* ✅ No comprimir composer */
}

.modal-comments-section .comments-list {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 4px 10px 8px 10px !important;
    margin: 0 !important;
    min-height: 200px !important; /* ✅ Mínimo razonable */
    max-height: none !important; /* ✅ Sin límite máximo - crece con contenido */
}

/* Scrollbar personalizado para lista de comentarios - MÁS VISIBLE */
.modal-comments-section .comments-list::-webkit-scrollbar {
    width: 8px !important; /* Más ancho para mejor visibilidad */
}

.modal-comments-section .comments-list::-webkit-scrollbar-track {
    background: #f1f1f1 !important; /* Fondo visible para el track */
    border-radius: 4px !important;
}

.modal-comments-section .comments-list::-webkit-scrollbar-thumb {
    background: var(--zikpic-green) !important; /* Color verde más visible */
    border-radius: 4px !important;
    border: 1px solid #f1f1f1 !important; /* Borde para contraste */
}

.modal-comments-section .comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--zikpic-dark-green) !important; /* Más oscuro al hover */
}

/* ================== Contador de comentarios en acciones ================== */
.modal-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--comment-border);
    background: var(--comment-bg);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--comment-text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
}

.action-item:hover {
    color: var(--zikpic-green);
}

.action-item i {
    font-size: 1.1rem;
}

/* ================== BBCode Spoiler ================== */
.zik-spoiler {
        background: #d9e1e1;
    color: #d9e1e1;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    user-select: none;
    position: relative;
    display: block;
    width: 80%;
    max-width: 300px;
}

.zik-spoiler::before {
    content: "👁️ Spoiler - Clic para revelar";
    color: #5e6e6d;
    font-size: 0.85rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    pointer-events: none;
}

.zik-spoiler.revealed {
    background: #f8f9fa;
    color: #333;
    border: 1px dashed #dee2e6;
}

.zik-spoiler.revealed::before {
    display: none;
}

.zik-spoiler:not(.revealed):hover {
    background: #d9e1e1;
}

/* ================== Modal Spoiler Personalizado ================== */
.zik-spoiler-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    animation: fadeIn 0.2s ease;
}

.zik-spoiler-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.zik-spoiler-modal h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 1.2rem;
}

.zik-spoiler-modal input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.zik-spoiler-modal input:focus {
    outline: none;
    border-color: var(--zikpic-green);
}

.zik-spoiler-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.zik-spoiler-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.zik-spoiler-modal-btn.primary {
    background: var(--zikpic-green);
    color: white;
}

.zik-spoiler-modal-btn.primary:hover {
    background: #5a9d5a;
    transform: translateY(-1px);
}

.zik-spoiler-modal-btn.secondary {
    background: #f1f3f6;
    color: #666;
}

.zik-spoiler-modal-btn.secondary:hover {
    background: #e9ecef;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ================== Emojis Personalizados ================== */
.custom-emoji {
    width: 20px !important;
    height: 20px !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
    display: inline-block !important;
    border: none !important;
    background: none !important;
}

.comment-content .custom-emoji {
    max-width: 20px;
    max-height: 20px;
}

/* ================== Responsive ================== */
@media (max-width: 768px) {
    .comment-composer {
        padding: 14px;
        margin-bottom: 16px;
    }
    
    .comment-input {
        min-height: 70px;
        font-size: 0.95rem;
    }
    
    .comment-tools {
        gap: 6px;
    }
    
    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .comment-item {
        padding: 12px;
    }
    
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .comments-filters {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-comments-section .comment-composer,
    .modal-comments-section .comments-list {
        margin-left: 16px;
        margin-right: 16px;
    }
    
    .modal-comments-section .comments-header {
        padding: 0 16px;
    }
    
    /* Ajustes de altura para tablets */
    .modal-comments-section .comments-list {
        min-height: calc(50vh - 100px) !important;
        max-height: calc(70vh - 100px) !important;
    }
}

@media (max-width: 480px) {
    .comment-composer-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .comment-tools {
        order: 2;
        justify-content: center;
    }
    
    .comment-send-btn {
        order: 1;
        align-self: stretch;
    }
    
    /* ✅ SOLUCIÓN 2: Composer colapsable con botón flotante */
    .modal-comments-section {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    
    .modal-comments-section .comments-header {
        flex-shrink: 0;
        padding: 8px !important;
    }
    
    .modal-comments-section .comments-list {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 4px 8px 60px 8px !important; /* Padding para el botón flotante */
        min-height: 0 !important;
    }
    
    /* COMPOSER MÓVIL - NUEVO DISEÑO: mostrar igual que desktop */
    .modal-comments-section .comment-composer {
        display: block !important; /* Mostrar siempre, no ocultar */
        position: relative !important; /* Posición normal, no fijo */
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
        background: white !important;
        padding: 16px !important; /* Padding normal como desktop */
        box-shadow: none !important;
        min-height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        border-radius: 0 !important;
        overscroll-behavior: auto !important;
        border-top: 1px solid #e0e1e3 !important; /* Separador superior */
    }
    
    /* Asegurar que el textarea sea visible */
    .modal-comments-section .comment-composer .comment-input {
        min-height: 80px !important;
        margin-bottom: 12px !important;
    }
    
    /* Asegurar que el footer sea visible */
    .modal-comments-section .comment-composer .comment-composer-footer {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-top: 8px !important;
        padding-bottom: 0 !important; /* Sin padding extra */
    }
    
    /* Asegurar que las tools sean visibles - IZQUIERDA como desktop */
    .modal-comments-section .comment-composer .comment-tools {
        display: flex !important;
        gap: 8px !important;
        order: 1 !important; /* Primero (izquierda) */
    }
    
    /* Asegurar que los botones de tools sean visibles y clickeables */
    .modal-comments-section .comment-composer .tool-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    
    /* Botón de enviar debe ir a la derecha */
    .modal-comments-section .comment-composer .comment-send-btn {
        padding: 12px 24px !important;
        font-size: 16px !important;
        min-height: 44px !important;
        flex-shrink: 0 !important;
        order: 2 !important; /* Segundo (derecha) */
    }
    
    /* NO usar clase active para mostrar/ocultar */
    .modal-comments-section .comment-composer.active {
        /* Sin cambios, ya está siempre visible */
    }
    
    /* Botón de cerrar del composer */
    .mobile-composer-close {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        background: transparent !important;
        border: none !important;
        font-size: 24px !important;
        cursor: pointer !important;
        z-index: 10000 !important;
        color: #666 !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        transition: background 0.2s ease !important;
    }
    
    .mobile-composer-close:hover {
        background: #f3f4f6 !important;
        color: #111 !important;
    }
    
    /* Botón flotante para abrir composer (elemento real) */
    .mobile-composer-trigger {
        position: fixed !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        right: 16px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        background: var(--zikpic-gradient, linear-gradient(135deg, #81d742 0%, #3ac403 100%)) !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 9998 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    
    .mobile-composer-trigger i {
        color: white !important;
        font-size: 22px !important;
    }
    
    .mobile-composer-trigger:active {
        transform: scale(0.95) !important;
    }
    
    /* Ocultar botón cuando composer está activo */
    .modal-comments-section.composer-active .mobile-composer-trigger {
        display: none !important;
    }
    
    .comment-composer-footer {
        gap: 12px;
        align-items: stretch;
    }
    
    .comment-tools {
        justify-content: flex-start;
    }
    
    .comment-send-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================== Animaciones ================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    animation: fadeInUp 0.3s ease-out;
}

.comments-section.expanding {
    animation: fadeInUp 0.4s ease-out;
}

/* ================== GIF PREVIEW OVERLAY STYLES ================== */
.zik-comment-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px;
    background: transparent;
    pointer-events: auto;
    z-index: 5;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    border-radius: inherit;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: none;
}

.zik-preview-gif-container {
    display: inline-block;
    position: relative;
    margin: 4px 8px 4px 0;
    vertical-align: middle;
}

.zik-preview-gif {
    max-width: 150px;
    max-height: 100px;
    border-radius: 6px;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zik-preview-gif:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zik-preview-gif-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.zik-preview-gif-container:hover .zik-preview-gif-remove {
    opacity: 1;
}

.zik-preview-gif-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .zik-preview-gif {
        max-width: 120px;
        max-height: 80px;
    }
    
    .zik-preview-gif-remove {
        opacity: 1; /* Siempre visible en móvil */
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* Dark theme support */
[data-theme="dark"] .zik-comment-preview-overlay {
    color: var(--comment-text);
}

/* ================== END GIF PREVIEW OVERLAY STYLES ================== */

/* ================== GIF PREVIEW STYLES ================== */
.zik-gif-preview-container {
    margin-top: 12px;
    padding: 12px;
    background: var(--comment-input-bg);
    border: 1px solid var(--comment-border);
    border-radius: 8px;
    display: none; /* Solo mostrar cuando hay GIFs */
}

.zik-gif-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--comment-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zik-gif-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zik-gif-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--comment-border);
    transition: all 0.3s ease;
}

.zik-gif-preview-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zik-gif-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zik-gif-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.zik-gif-preview-item:hover .zik-gif-preview-remove {
    opacity: 1;
}

.zik-gif-preview-remove:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .zik-gif-preview-item {
        width: 60px;
        height: 60px;
    }
    
    .zik-gif-preview-remove {
        width: 18px;
        height: 18px;
        font-size: 9px;
        opacity: 1; /* Siempre visible en móvil */
    }
    
    .zik-gif-preview-grid {
        gap: 6px;
    }
}

/* Dark theme support */
[data-theme="dark"] .zik-gif-preview-container {
    background: var(--comment-input-bg);
    border-color: var(--comment-border);
}

[data-theme="dark"] .zik-gif-preview-title {
    color: var(--comment-text);
}

/* ================== END GIF PREVIEW STYLES ================== */

/* ================== GIPHY API STYLES ================== */
.zik-giphy-wrapper {
    width: 100%;
    height: 300px;
    /* border-radius: 8px; */
    overflow: hidden;
    background: var(--comment-bg);
    /* border: 1px solid var(--comment-border); */
    display: flex;
    flex-direction: column;
}

.zik-giphy-search-header {
    padding: 6px;
    background: var(--comment-bg);
    display: flex;
    align-items: center;
}

.zik-giphy-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--comment-border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--comment-bg);
    color: var(--comment-text);
    transition: all 0.3s ease;
}

.zik-giphy-search-input:focus {
    border-color: var(--comment-accent);
    box-shadow: 0 0 0 2px rgba(var(--comment-accent-rgb), 0.1);
}

.zik-giphy-search-input::placeholder {
    color: var(--comment-text-light);
}

.zik-giphy-trending-btn {
    padding: 8px 16px;
    background: var(--comment-accent);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.zik-giphy-trending-btn:hover {
    background: var(--comment-accent-hover);
    transform: translateY(-1px);
}

.zik-giphy-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--comment-input-bg);
}

.zik-giphy-content::-webkit-scrollbar {
    width: 6px;
}

.zik-giphy-content::-webkit-scrollbar-track {
    background: var(--comment-input-bg);
}

.zik-giphy-content::-webkit-scrollbar-thumb {
    background: var(--comment-border);
    border-radius: 3px;
}

.zik-giphy-content::-webkit-scrollbar-thumb:hover {
    background: var(--comment-text-light);
}

.zik-gif-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.zik-gif-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark theme support for Giphy */
[data-theme="dark"] .zik-giphy-search-input {
    background: var(--comment-input-bg);
    border-color: var(--comment-border);
    color: var(--comment-text);
}

[data-theme="dark"] .zik-giphy-search-input::placeholder {
    color: var(--comment-text-light);
}

/* ================== END GIPHY API STYLES ================== */

/* ================== Respuestas anidadas ================== */
.reply-item {
    background: #fbfbfb !important;
    position: relative;
    margin-left: 30px !important;
    border-left: 2px solid rgb(224, 225, 227) !important;
    padding-left: 10px !important;
    margin-top: 0px !important;
}

/* .reply-item::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--comment-border);
} */

/* Composer de respuestas */
.zik-reply-composer {
    background: var(--comment-bg);
    border: 2px solid var(--zikpic-light-green);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0 12px 44px;
    box-shadow: 0 4px 12px rgba(129, 215, 66, 0.15);
    position: relative;
    animation: slideInUp 0.3s ease-out;
}

.zik-reply-composer::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--zikpic-light-green);
}

.zik-reply-input {
    width: 100%;
    border: 1px solid var(--comment-border);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    font-family: inherit;
    background: #fafbfc;
    transition: all 0.2s ease;
}

.zik-reply-input:focus {
    outline: none;
    border-color: var(--zikpic-green);
    box-shadow: 0 0 0 3px rgba(129, 215, 66, 0.1);
    background: var(--comment-bg);
}

.zik-reply-input::placeholder {
    color: var(--comment-text-light);
    font-style: italic;
}

.zik-reply-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.zik-reply-send-btn, .zik-reply-cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zik-reply-send-btn {
    background: var(--zikpic-green);
    color: white;
}

.zik-reply-send-btn:hover:not(:disabled) {
    background: var(--zikpic-dark-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(129, 215, 66, 0.3);
}

.zik-reply-send-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.zik-reply-cancel-btn {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid var(--comment-border);
}

.zik-reply-cancel-btn:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

.zik-reply-left-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.zik-reply-right-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
/* ================== Botón de emoticonos en respuestas ================== */
.zik-reply-emotes {
    background: none !important;
    border: 1px solid var(--comment-border) !important;
    border-radius: 8px !important;
    padding: 8px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    position: relative !important; /* Contexto para el picker */
    color: var(--comment-text-light) !important;
}

.zik-reply-emotes:hover {
    background: #f1f3f6 !important;
    border-color: var(--zikpic-green) !important;
    color: var(--zikpic-green) !important;
    transform: scale(1.05) !important;
}

.zik-reply-emotes:active {
    background: #e1e4e8 !important;
    /* transform: scale(0.95) !important; */
}

/* ================== Picker Unificado tipo WhatsApp ================== */

/* Boost z-index of containers with active picker */
.zik-comment-actions:has(.zik-unified-picker),
.zik-reply-actions:has(.zik-unified-picker) {
    z-index: 2147483646 !important;
    /* position: relative !important; */
}

.zik-unified-picker {
   /* position: absolute !important;
     top, bottom y left se controlan dinámicamente desde JS */
    background: #ffffff !important;
    border: 1px solid #d1d5da !important;
    border-radius: 8px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4) !important;
    z-index: 2147483647 !important; /* Z-index máximo posible */
    width: 320px !important;
    /* max-height se controla dinámicamente desde JS */
    overflow: hidden !important; /* Cambiado a hidden para que respete los bordes redondeados */
    /* margin-top y margin-bottom se controlan desde JS */
    isolation: isolate !important;
    backdrop-filter: blur(2px) !important;
    
    /* Mejoras para evitar clipping */
    will-change: transform !important;
    contain: layout style !important;
    
    /* Asegurar que esté por encima de todo */
    transform: translateZ(0) !important;
    
    /* Estructura flex para controlar contenido */
    display: flex !important;
    flex-direction: column !important;
}

/* Variante con position fixed para casos extremos de clipping */
.zik-unified-picker.fixed-position {
    position: fixed !important;
    transform: translateY(0) !important;
}

/* Header con pestañas */
.zik-picker-header {
    display: flex !important;
    border-bottom: 2px solid var(--comment-border) !important;
    background: #f8fafc !important;
    border-radius: 8px 8px 0 0 !important; /* Ajustado para coincidir con el picker (8px) */
    flex-shrink: 0 !important; /* No reducir el header */
}

.zik-picker-tab {
    flex: 1 !important;
    padding: 12px 16px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    color: var(--comment-text-light) !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    font-size: 14px !important;
}

.zik-picker-tab:first-child {
    border-radius: 8px 0 0 0 !important; /* Ajustado para coincidir */
}

.zik-picker-tab:last-child {
    border-radius: 0 8px 0 0 !important; /* Ajustado para coincidir */
}

.zik-picker-tab.active {
    color: var(--zikpic-green) !important;
    background: var(--comment-bg) !important;
}

.zik-picker-tab.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: var(--zikpic-green) !important;
}

.zik-picker-tab:hover:not(.active) {
    background: rgba(129, 215, 66, 0.1) !important;
    color: var(--zikpic-dark-green) !important;
}

/* Contenido del picker */
.zik-picker-content {
    /*padding: 16px !important;  Agregado padding para que el contenido no toque los bordes */
    /* max-height controlado desde JS */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 !important; /* Tomar todo el espacio disponible */
    min-height: 0 !important; /* Importante para flex scroll */
    border-radius: 0 0 8px 8px !important; /* Bordes redondeados en la parte inferior */
    
    /* Ocultar scrollbar pero mantener funcionalidad */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE y Edge */
}

/* Ocultar scrollbar en Chrome, Safari y Opera */
.zik-picker-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Grid para emojis y stickers */
.zik-emotes-grid {
    display: grid !important;
    /* gap: 8px !important; */
}

.zik-emojis-grid {
    grid-template-columns: repeat(8, 1fr) !important;
}

.zik-stickers-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    max-height: 300px;
    gap: 6px !important;
    padding: 8px;
}

.zik-emote-item {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.zik-emote-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 6px !important;
}

.zik-emote-item:hover {
    background: var(--zikpic-light-green) !important;
    /* transform: scale(1.15) !important; */
    box-shadow: 0 2px 8px rgba(129, 215, 66, 0.3) !important;
    z-index: 10 !important;
}

/* Área de GIFs */
.zik-gifs-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.zik-gif-search-container {
    position: relative !important;
}

.zik-gif-search {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid var(--comment-border) !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
}

.zik-gif-search:focus {
    outline: none !important;
    border-color: var(--zikpic-green) !important;
    box-shadow: 0 0 0 3px rgba(129, 215, 66, 0.1) !important;
    background: var(--comment-bg) !important;
}

.zik-gifs-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
}

.zik-gif-item {
    width: 100% !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 2px solid transparent !important;
}

.zik-gif-item:hover {
    transform: scale(1.05) !important;
    border-color: var(--zikpic-green) !important;
    box-shadow: 0 4px 12px rgba(129, 215, 66, 0.3) !important;
}

/* Estados de carga */
.zik-picker-loading {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 40px !important;
    color: var(--comment-text-light) !important;
    font-style: italic !important;
}

.zik-picker-empty {
    text-align: center !important;
    padding: 40px 20px !important;
    color: var(--comment-text-light) !important;
    font-style: italic !important;
}

.zik-picker-error {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #e74c3c !important;
    font-weight: 500 !important;
}

/* Ocultar pickers antiguos */
.zik-emoji-picker, 
.zik-sticker-picker, 
.zik-gif-picker {
    display: none !important;
}

/* ================== Pickers: Base común ================== */
.zik-emoji-picker, 
.zik-sticker-picker, 
.zik-gif-picker {
    position: absolute !important;
    background: var(--comment-bg) !important;
    border: 2px solid var(--zikpic-green) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 8px 32px rgba(129, 215, 66, 0.2), 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    z-index: 1000 !important;
    top: 100% !important;
    left: 0 !important;
    margin-top: 8px !important;
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

/* ================== Picker de Emojis ================== */
.zik-emoji-picker {
    width: 350px !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 6px !important;
}

.zik-emoji-picker::before {
    content: '😀 Emojis';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--zikpic-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.zik-emoji-picker button {
    border: none !important;
    background: none !important;
    font-size: 24px !important;
    padding: 8px !important;
    cursor: pointer !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    position: relative !important;
}

.zik-emoji-picker button:hover {
    background: var(--zikpic-light-green) !important;
    transform: scale(1.2) !important;
    box-shadow: 0 2px 8px rgba(129, 215, 66, 0.3) !important;
    z-index: 10 !important;
}

/* ================== Picker de Stickers ================== */
.zik-sticker-picker {
    width: 320px !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
}

.zik-sticker-picker::before {
    content: '🎭 Stickers';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--zikpic-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.zik-sticker-picker .sticker-item {
    width: 45px !important;
    height: 45px !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 30px !important;
    position: relative !important;
}

.zik-sticker-picker .sticker-item:hover {
    background: var(--zikpic-light-green) !important;
    transform: scale(1.15) !important;
    box-shadow: 0 2px 8px rgba(129, 215, 66, 0.3) !important;
    z-index: 10 !important;
}

/* ================== Picker de GIFs ================== */
.zik-gif-picker {
    width: 380px !important;
    max-height: 360px !important;
    overflow-y: auto !important;
}

.zik-gif-picker::before {
    content: '🎬 GIFs';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--zikpic-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.zik-gif-search {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid var(--comment-border) !important;
    border-radius: 10px !important;
    margin-bottom: 16px !important;
    font-size: 14px !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
}

.zik-gif-search:focus {
    outline: none !important;
    border-color: var(--zikpic-green) !important;
    box-shadow: 0 0 0 3px rgba(129, 215, 66, 0.1) !important;
    background: var(--comment-bg) !important;
}

.zik-gif-search::placeholder {
    color: var(--comment-text-light) !important;
    font-style: italic !important;
}

.zik-gif-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
}

.zik-gif-item {
    width: 100% !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 2px solid transparent !important;
}

.zik-gif-item:hover {
    transform: scale(1.05) !important;
    border-color: var(--zikpic-green) !important;
    box-shadow: 0 4px 12px rgba(129, 215, 66, 0.3) !important;
}



.zik-gifs-container {
    padding: 10px;
}

.zik-gif-search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.zik-gif-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
}

.zik-gif-search-btn {
    padding: 8px 12px;
    background: #0366d6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.zik-gif-search-btn:hover {
    background: #0256cc;
}

.zik-gif-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.zik-gif-category-btn {
    padding: 4px 8px;
    background: #f1f3f4;
    border: 1px solid #d1d5da;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.zik-gif-category-btn:hover {
    background: #e1e4e8;
    border-color: #586069;
}

.zik-gifs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}
/* ================== Scrollbars personalizados para pickers ================== */
.zik-emoji-picker::-webkit-scrollbar,
.zik-sticker-picker::-webkit-scrollbar,
.zik-gif-picker::-webkit-scrollbar {
    width: 6px;
}

.zik-emoji-picker::-webkit-scrollbar-track,
.zik-sticker-picker::-webkit-scrollbar-track,
.zik-gif-picker::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.zik-emoji-picker::-webkit-scrollbar-thumb,
.zik-sticker-picker::-webkit-scrollbar-thumb,
.zik-gif-picker::-webkit-scrollbar-thumb {
    background: var(--zikpic-green);
    border-radius: 3px;
}

.zik-emoji-picker::-webkit-scrollbar-thumb:hover,
.zik-sticker-picker::-webkit-scrollbar-thumb:hover,
.zik-gif-picker::-webkit-scrollbar-thumb:hover {
    background: var(--zikpic-dark-green);
}

/* ================== Animaciones para pickers y respuestas ================== */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================== Estados de loading y empty para pickers ================== */
.picker-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    color: var(--comment-text-light);
    font-style: italic;
}

.picker-empty {
    text-align: center;
    padding: 30px;
    color: var(--comment-text-light);
    font-style: italic;
}

/* ================== Responsive para pickers ================== */
@media (max-width: 480px) {
    .zik-emoji-picker {
        width: 300px !important;
        grid-template-columns: repeat(6, 1fr) !important;
    }
    .zik-unified-picker {
    width: 280px !important;
    z-index: 2147483647 !important; /* Z-index máximo posible */
}
    
    .zik-sticker-picker {
        width: 280px !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .zik-gif-picker {
        width: 320px !important;
    }
    
    .zik-gif-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .zik-reply-composer {
        margin-left: 20px !important;
        padding: 12px !important;
    }
}

/* ================== Ocultar modal innecesario ================== */
.zik-comments-modal {
    display: none !important;
}

.zik-modal-content,
.zik-modal-header,
.zik-modal-body,
.zik-modal-close {
    display: none !important;
}

/* ================== Modal oculto (no se usa actualmente) ================== */
.zik-comments-modal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

/* ================== Sistema GIFs tipo Webtoons con Giphy ================== */
.zik-gif-header {
    padding: 15px !important;
    border-bottom: 1px solid var(--comment-border) !important;
    background: #f8fafc !important;
}

.zik-gif-search-container {
    position: relative !important;
    margin-bottom: 10px !important;
}

.zik-gif-search-icon {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8 !important;
    z-index: 1 !important;
}

.zik-gif-search {
    width: 100% !important;
    padding: 12px 16px 12px 40px !important;
    border: 2px solid var(--comment-border) !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    background: white !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0 !important;
}

.zik-gif-search:focus {
    outline: none !important;
    border-color: var(--zikpic-green) !important;
    box-shadow: 0 0 0 3px rgba(129, 215, 66, 0.1) !important;
}

.zik-gif-powered {
    text-align: center !important;
    font-size: 11px !important;
    color: #64748b !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

.giphy-logo {
    color: #00ff99 !important;
    font-weight: 800 !important;
}

.zik-gifs-scroll {
    max-height: 300px !important;
    overflow-y: auto !important;
    padding: 15px !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    background: white !important;
}

.zik-gifs-scroll .zik-gif-item {
    position: relative !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
    transition: all 0.2s ease !important;
    height: auto !important;
    border: none !important;
    display: block !important;
}

.zik-gifs-scroll .zik-gif-item:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
}

.zik-gifs-scroll .zik-gif-item img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

.zik-gif-loading {
    text-align: center !important;
    padding: 20px !important;
    color: var(--comment-text-light) !important;
    font-size: 14px !important;
}

/* Scrollbar específico para el grid de GIFs Giphy */
.zik-gifs-scroll::-webkit-scrollbar {
    width: 6px !important;
}

.zik-gifs-scroll::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 3px !important;
}

.zik-gifs-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

.zik-gifs-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* ================== Sistema de encapsulación (opcional) ================== */
/* Wrapper opcional para encapsular todo el sistema de comentarios */
.zik-comments-system {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--comment-text) !important;
    background: var(--comment-bg) !important;
    border-radius: 12px !important;
    box-shadow: var(--comment-shadow) !important;
    margin: 20px 0 !important;
    overflow: visible !important; /* Asegurar que los pickers se vean */
    position: relative !important; /* Contexto de posicionamiento */
    border: 1px solid var(--comment-border) !important;
}

.zik-comments-system * {
    box-sizing: border-box !important;
}

/* ================== Soporte para tema oscuro (opcional) ================== */
.zik-comments-system[data-theme="dark"] {
    --comment-bg: #1a1a1a;
    --comment-text: #e1e4e8;
    --comment-text-light: #8b949e;
    --comment-border: #404040;
    --comment-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: var(--comment-bg) !important;
    color: var(--comment-text) !important;
}

.zik-comments-system[data-theme="dark"] .comment-input {
    background: #2d2d2d !important;
    border-color: var(--comment-border) !important;
    color: var(--comment-text) !important;
}

.zik-comments-system[data-theme="dark"] .comment-item {
    border-color: var(--comment-border) !important;
}

.zik-comments-system[data-theme="dark"] .comment-item:hover {
    background: #2d2d2d !important;
}

/* ================== Estados adicionales del sistema ================== */
.zik-loading {
    padding: 40px !important;
    text-align: center !important;
    color: var(--comment-text-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-style: italic !important;
}

.zik-loading i {
    animation: pulse 1.5s infinite !important;
}

.zik-empty-comments {
    padding: 40px !important;
    text-align: center !important;
    color: var(--comment-text-light) !important;
    /* font-style: italic !important; */
}

.zik-empty-comments i {
    font-size: 48px !important;
    margin-bottom: 16px !important;
    opacity: 0.5 !important;
    color: var(--comment-border) !important;
}

/* ================== Animación pulse para loading ================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ================== PICKER DE EMOJIS CATEGORIZADOS ================== */
.zik-emojis-categorized {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.zik-emoji-nav {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 2px solid var(--comment-border);
    flex-shrink: 0;
}

.zik-emoji-arrow {
    background: none;
    border: none;
    padding: 10px 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--comment-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 44px;
}

.zik-emoji-arrow:hover:not(:disabled) {
    background: #e9ecef;
    color: var(--zikpic-green);
}

.zik-emoji-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.zik-emoji-tabs-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.zik-emoji-tabs {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.zik-emoji-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.zik-emoji-tab {
    background: none;
    border: none;
    padding: 5px 16px;
    font-size: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: var(--comment-text-light);
    border-bottom: 3px solid transparent;
    min-width: fit-content;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.zik-emoji-tab:hover {
    background: #e9ecef;
    color: var(--comment-text);
    transform: scale(1.1);
}

.zik-emoji-tab.active {
    color: var(--zikpic-green);
    border-bottom-color: var(--zikpic-green);
    background: white;
    font-weight: 600;
    transform: scale(1.15);
}

.zik-emoji-tab.zik-emoji-history {
    border-left: 1px solid var(--comment-border);
    margin-left: 8px;
}

.zik-emoji-content {
    flex: 1;
    overflow-y: hidden;
    padding: 10px;
    background: white;
}

.zik-emoji-category {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
}

.zik-unicode-emoji {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.zik-unicode-emoji:hover {
    background: #f0f0f0;
    border-color: var(--zikpic-green);
   /*  transform: scale(1.1); */
}

.zik-unicode-emoji:active {
    transform: scale(0.95);
    background: var(--zikpic-light-green);
}

/* Scrollbar personalizado para contenido */
.zik-emoji-content::-webkit-scrollbar,
.zik-emoji-category::-webkit-scrollbar {
    width: 6px;
}

.zik-emoji-content::-webkit-scrollbar-track,
.zik-emoji-category::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.zik-emoji-content::-webkit-scrollbar-thumb,
.zik-emoji-category::-webkit-scrollbar-thumb {
    background: var(--zikpic-green);
    border-radius: 3px;
}

.zik-emoji-content::-webkit-scrollbar-thumb:hover,
.zik-emoji-category::-webkit-scrollbar-thumb:hover {
    background: var(--zikpic-dark-green);
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    .zik-emoji-nav {
        height: 50px;
    }
    
    .zik-emoji-arrow {
        padding: 8px 6px;
        font-size: 16px;
        min-width: 32px;
        height: 40px;
    }
    
    .zik-emoji-tab {
        padding: 10px 12px;
        font-size: 18px;
    }
    
    .zik-emoji-category {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 6px;
    }
    
    .zik-unicode-emoji {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* ================== Lazy Loading - Indicador de Carga ================== */
.comments-loading-indicator {
    padding: 20px;
    text-align: center;
    background: var(--comment-bg);
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--comment-border);
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--comment-text-light);
    font-size: 14px;
}

.loading-spinner i {
    color: var(--zikpic-green);
    font-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================== Estados de carga optimizados ================== */
.comments-list.loading {
    opacity: 0.7;
    pointer-events: none;
}

.comments-list.appending .comments-loading-indicator {
    border-top: 2px solid var(--zikpic-green);
    background: linear-gradient(to right, #f8f9fa, #ffffff);
}

/* ================== Responsive para indicadores ================== */
@media (max-width: 768px) {
    .comments-loading-indicator {
        padding: 15px;
        margin: 8px 0;
    }
    
    .loading-spinner {
        font-size: 13px;
        gap: 10px;
    }
    
    .loading-spinner i {
        font-size: 14px;
    }
}

/* ========= NUEVO: Isolation Container para replies - Performance optimizado ========= */
.zik-picker-isolation-container {
    /* Aislamiento de rendering para evitar reflows del DOM pesado */
    transform: translateZ(0);           /* Force hardware acceleration */
    will-change: auto;                  /* Optimize for changes */
    contain: layout style paint;       /* CSS containment para aislar del DOM pesado */
    isolation: isolate;                /* Create stacking context */
    
    /* SUPER AGRESIVO: Eliminar TODAS las animaciones */
    animation: none !important;
    transition: none !important;
}

.zik-picker-isolation-container .zik-unified-picker {
    /* Re-habilitar eventos solo en el picker */
    pointer-events: auto;
    
    /* Performance optimizations específicas para replies */
    transform: translateZ(0);
    backface-visibility: hidden;
    
    /* SUPER AGRESIVO: Eliminar animaciones problemáticas del DOM pesado */
    animation: none !important;
    transition: none !important;
}

/* SUPER AGRESIVO: Eliminar TODAS las animaciones dentro del picker de replies */
.zik-picker-isolation-container .zik-unified-picker *,
.zik-picker-isolation-container .zik-unified-picker *::before,
.zik-picker-isolation-container .zik-unified-picker *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* Evitar que el DOM pesado de replies interfiera con el picker */
.zik-reply-composer .zik-picker-isolation-container {
    /* Aislar completamente del contexto de reply composer */
    position: absolute !important;
    z-index: 2147483647 !important;
    
    /* BLOQUEAR interferencias del parent */
    contain: layout style paint !important;
}

/* ========= ESTILOS PARA REPLY PICKER (NIVEL 2) ========= */

.zik-reply-picker-container {
    position: absolute !important;
    z-index: 2147483647 !important;
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4) !important;
    width: 320px !important;
    max-height: 400px !important;
    overflow: hidden !important;
    isolation: isolate !important;
    backdrop-filter: blur(2px) !important;
}

.zik-reply-picker {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.zik-reply-picker-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 8px 12px !important;
}

.zik-reply-picker-tabs {
    display: flex !important;
    gap: 4px !important;
}

.zik-reply-tab {
    background: transparent !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    color: #666 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.zik-reply-tab:hover {
    background: #e9ecef !important;
    color: #333 !important;
}

.zik-reply-tab.active {
    background: #007bff !important;
    color: white !important;
}

.zik-reply-picker-close {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    color: #666 !important;
    cursor: pointer !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.zik-reply-picker-close:hover {
    background: #e9ecef !important;
    color: #333 !important;
}

.zik-reply-picker-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 12px !important;
}

.zik-reply-tab-content {
    display: none !important;
}

.zik-reply-tab-content.active {
    display: block !important;
}

/* Emojis */
.zik-reply-emoji-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.zik-reply-emoji-category h4 {
    margin: 0 0 8px 0 !important;
    font-size: 12px !important;
    color: #666 !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

.zik-reply-emoji-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

.zik-reply-emoji-btn {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: background 0.2s ease !important;
}

.zik-reply-emoji-btn:hover {
    background: #f8f9fa !important;
}

/* Stickers */
.zik-reply-sticker-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)) !important;
    gap: 8px !important;
}

.zik-reply-sticker-btn {
    background: none !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: background 0.2s ease !important;
}

.zik-reply-sticker-btn:hover {
    background: #f8f9fa !important;
}

.zik-reply-sticker-btn img {
    width: 100% !important;
    height: auto !important;
    max-width: 50px !important;
    border-radius: 4px !important;
}

/* GIFs */
.zik-reply-gif-search {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
}

.zik-reply-gif-search-input {
    flex: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
}

.zik-reply-gif-search-btn {
    background: #007bff !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

.zik-reply-gif-search-btn:hover {
    background: #0056b3 !important;
}

.zik-reply-gif-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 8px !important;
}

.zik-reply-gif-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.zik-reply-gif-btn img {
    width: 100% !important;
    height: auto !important;
    border-radius: 4px !important;
}

.zik-reply-picker-container .loading, 
.zik-reply-picker-container .error {
    text-align: center !important;
    padding: 20px !important;
    color: #666 !important;
    font-size: 14px !important;
}

.zik-reply-picker-container .error {
    color: #dc3545 !important;
}

/* ================== MODAL DE LOGIN PARA USUARIOS NO LOGUEADOS ================== */
.zik-login-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.zik-login-modal * {
    box-sizing: border-box;
}

.zik-login-modal-content {
    animation: zikLoginModalEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zikLoginModalEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive para el modal de login */
@media (max-width: 480px) {
    .zik-login-modal-content {
        margin: 20px;
        padding: 25px 20px;
        border-radius: 16px;
    }
    
    .zik-login-modal-content h3 {
        font-size: 1.3rem !important;
    }
    
    .zik-login-modal-content p {
        font-size: 0.95rem !important;
    }
    
    .zik-login-modal-content .zik-login-btn,
    .zik-login-modal-content .zik-register-btn {
        font-size: 0.9rem !important;
        padding: 10px 20px !important;
    }
}

/* ================== FIN ESTILOS DE COMENTARIOS ================== */
