/* Estilos para el sistema de comentarios expandible */

.xioleni-comments-section {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
    border: 1px solid rgba(255, 92, 0, 0.2);
    border-top: none;
    border-radius: 0 0 15px 15px;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    box-sizing: border-box;
}

/* Fondo para temas claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comments-section,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section {
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff) !important;
    border-top: none !important;
}

@keyframes xioleniCommentsExpand {
    0% {
        max-height: 0;
        opacity: 0;
        padding: 0 20px;
    }
    100% {
        max-height: 400px;
        opacity: 1;
        padding: 20px;
    }
}

.xioleni-comments-section * {
    opacity: 1 !important;
    color: inherit !important;
}

.xioleni-comments-section,
.xioleni-comments-section *,
.xioleni-comments-section h4,
.xioleni-comments-section span,
.xioleni-comments-section div,
.xioleni-comments-section button,
.xioleni-comments-section input {
    opacity: 1 !important;
    visibility: visible !important;
    color: #ff5c00 !important;
}

/* Asegurar que la sección se integre correctamente en el post */
.xioleni-comments-section[data-post-id] {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Forzar que todo el contenido permanezca visible permanentemente */
.xioleni-comments-section,
.xioleni-comments-section *,
.xioleni-comments-section .xioleni-comments-header,
.xioleni-comments-section .xioleni-comments-header *,
.xioleni-comments-section .xioleni-comments-list,
.xioleni-comments-section .xioleni-comments-list *,
.xioleni-comments-section .xioleni-comment-item,
.xioleni-comments-section .xioleni-comment-item *,
.xioleni-comments-section .xioleni-comment-text,
.xioleni-comments-section .xioleni-comment-form,
.xioleni-comments-section .xioleni-comment-form * {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    color: inherit !important;
}

/* Regla específica para el contenedor de autor - debe ser flex */
.xioleni-comments-section .xioleni-comment-author {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    color: inherit !important;
}

/* Excepciones para elementos que deben mantener su display original */
.xioleni-comments-section .xioleni-comments-header,
.xioleni-comments-section .xioleni-comment-form {
    display: flex !important;
}

.xioleni-comments-section .xioleni-comments-close svg,
.xioleni-comments-section button svg {
    display: inline-block !important;
}

/* Prevenir que JavaScript pueda ocultar el contenido */
.xioleni-comments-section[style*="display: none"],
.xioleni-comments-section *[style*="display: none"]:not(.xioleni-comment-author),
.xioleni-comments-section *[style*="visibility: hidden"] {
    display: block !important;
    visibility: visible !important;
}

/* Excepción específica para el contenedor de autor - debe mantener flex */
.xioleni-comments-section .xioleni-comment-author[style*="display: none"] {
    display: flex !important;
    visibility: visible !important;
}

/* Reglas ultra específicas para forzar visibilidad permanente */
.xioleni-comments-section .xioleni-comment-text,
.xioleni-comments-section h4 {
    opacity: 1 !important;
    visibility: visible !important;
    color: inherit !important;
    display: block !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* Colores para fondos oscuros y medio oscuros (por defecto) */
.xioleni-comments-section .xioleni-comment-author {
    color: #ff5c00 !important;
}

.xioleni-comments-section .xioleni-comment-text {
    color: #fff !important;
}



.xioleni-comments-section .xioleni-comments-header h4 {
    color: #fff !important;
}

.xioleni-comments-section .xioleni-close-btn {
    color: #fff !important;
}

/* Colores para fondos claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comment-name,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comment-name {
    color: #333 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comment-text,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comment-text {
    color: #333 !important;
}



.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comments-header h4,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comments-header h4 {
    color: #333 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-close-btn,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-close-btn {
    color: #333 !important;
}

/* Forzar todos los textos a ser oscuros en fondos claros */
.xioleni-post[data-theme="light"] .xioleni-comments-section,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section {
    color: #333 !important;
}

/* Excepciones para elementos que deben mantener colores específicos */
.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comment-author,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comment-author {
    color: #ff5c00 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comment-text,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comment-text {
    color: #333 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comment-date,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comment-date {
    color: #666 !important;
}

/* Scroll suave para la lista de comentarios */
.xioleni-comments-section .xioleni-comments-list {
    scrollbar-width: thin;
    scrollbar-color: #34a6b1 rgba(255, 255, 255, 0.1);
}

.xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar {
    width: 6px;
}

.xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #790847, #ff5c00);
    border-radius: 3px;
}

/* Scroll para temas claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comments-list,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comments-list {
    scrollbar-color: #34a6b1 #607D8B !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-track,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-track {
    background: rgba(121, 8, 71, 0.2) !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-thumb,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-section .xioleni-comments-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #790847, #a00b5c) !important;
}

.xioleni-comments-header {
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ajustes para PC y tablet - más altura y menos espacio */
@media (min-width: 769px) {
    .xioleni-comments-header {
        margin-bottom: 14px !important;
        padding-bottom: 8px !important;
        margin-top: 0px !important;
    }
    
    .xioleni-comments-close {
        position: relative !important;
        margin-top: -5px !important;
        margin-left: 10px !important;
        z-index: 100 !important;
    }
    
    .xioleni-comments-list {
        max-height: 380px !important;
        margin-top: 0px !important;
    }
}

/* Header para temas claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comments-header,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-header {
    border-bottom: 1px solid rgba(121, 8, 71, 0.2) !important;
}

.xioleni-comments-header h4 {
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.xioleni-comments-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    gap: 6px;
    font-size: 14px;
}

.xioleni-comments-close-text {
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center !important;
}

.xioleni-comments-section .xioleni-comments-close > span,
.xioleni-comments-section .xioleni-comments-close > svg,
.xioleni-comments-section .xioleni-comments-close > * {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
}

.xioleni-comments-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Botón de cerrar para temas claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comments-close,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-close {
    color: #333 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comments-close:hover,
.xioleni-post[data-theme="medium-light"] .xioleni-comments-close:hover {
    background: rgba(121, 8, 71, 0.1) !important;
    transform: scale(1.1);
}

.xioleni-comments-list {
    margin-bottom: 0;
    padding-right: 10px;
    max-height: 300px; /* Altura fija para comentarios */
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1; /* Toma el espacio disponible */
    min-height: 0; /* Permite que se comprima si es necesario */
}

.xioleni-comment-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 92, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Estilos para comentarios en fondo claro */
.xioleni-post[data-theme="light"] .xioleni-comment-item {
    background: rgb(255, 255, 255) !important;
}

/* Estilos para comentarios en fondo medio claro */
.xioleni-post[data-theme="medium-light"] .xioleni-comment-item {
    background: rgb(157, 186, 197) !important;
    box-shadow: 0 2px 4px rgba(121, 8, 71, 0.2) !important;
}

/* Lista de comentarios para fondos claros */
.xioleni-post[data-theme="light"] .xioleni-comments-list {
    background: rgba(218, 233, 239, 0) !important;
}


.xioleni-comment-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

/* Hover para comentarios en fondo claro */
.xioleni-post[data-theme="light"] .xioleni-comment-item:hover {
    background: rgb(200, 220, 230) !important;
    transform: translateX(2px);
}

/* Hover para comentarios en fondo medio claro */
.xioleni-post[data-theme="medium-light"] .xioleni-comment-item:hover {
    background: rgb(140, 170, 180) !important;
    transform: translateX(2px);
}

.xioleni-comment-author {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    font-size: 14px;
    margin-bottom: 8px !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 0 !important;
}

/* Regla ultra específica para forzar flexbox en el contenedor de autor */
.xioleni-comments-section .xioleni-comment-item .xioleni-comment-author,
.xioleni-comments-section .xioleni-comment-author {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

/* Regla con máxima especificidad para garantizar layout horizontal */
body .xioleni-comments-section .xioleni-comment-item .xioleni-comment-author {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    margin-bottom: 8px !important;
}

body .xioleni-comments-section .xioleni-comment-item .xioleni-comment-author .xioleni-comment-photo {
    flex-shrink: 0 !important;
    margin-right: 12px !important;
    display: inline-flex !important;
}

body .xioleni-comments-section .xioleni-comment-item .xioleni-comment-author .xioleni-comment-name {
    flex: 1 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.xioleni-comment-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #698e97;
    margin-right: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid #e0e0e0;
    box-sizing: border-box;
    vertical-align: middle;
}

.xioleni-comment-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.xioleni-comment-delete {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #ff5c00 !important;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
}

.xioleni-comment-delete:hover {
    opacity: 1;
}

.xioleni-comment-name {
    font-weight: bold !important;
    color: #fff !important;
    flex: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center !important;
}

.xioleni-comment-text {
    color: #fff !important;
    line-height: 1.4;
    margin-bottom: 8px;
    word-wrap: break-word;
    opacity: 1 !important;
    visibility: visible !important;
}



.xioleni-no-comments {
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
    font-style: italic;
}



.xioleni-comment-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.xioleni-comment-input::placeholder {
    color: #aaa;
}

.xioleni-comment-input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 92, 0, 0.3);
}

/* Estilos del input para fondos claros y medio claros */
.xioleni-post[data-theme="light"] .xioleni-comment-input,
.xioleni-post[data-theme="medium-light"] .xioleni-comment-input {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comment-input::placeholder,
.xioleni-post[data-theme="medium-light"] .xioleni-comment-input::placeholder {
    color: #666 !important;
}

.xioleni-post[data-theme="light"] .xioleni-comment-input:focus,
.xioleni-post[data-theme="medium-light"] .xioleni-comment-input:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 0 0 2px rgba(8, 85, 121, 0.4) !important;
}

.xioleni-comments-section .xioleni-comment-submit {
    background: #ff5c00 !important;
    color: #fff !important;
    border: none;
    border-radius: 25px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
    align-self: center;
}

.xioleni-comments-section .xioleni-comment-submit:hover {
    background: #ff7a33 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 92, 0, 0.3);
}

.xioleni-comments-section .xioleni-comment-submit:active {
    background: #ff7a33 !important;
    transform: translateY(0);
}

.xioleni-comment-count {
    animation: xioleniCounterPulse 0.3s ease-out;
}

@keyframes xioleniCounterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Asegurar que el formulario siempre esté visible y fijo en la parte inferior */
.xioleni-comment-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-shrink: 0; /* Nunca se comprime */
    margin-top: auto !important; /* Se empuja hacia abajo */
    margin-bottom: 0 !important;
    background: inherit;
    padding: 15px 0 10px 0;
    z-index: 10;
    position: sticky;
    bottom: 0;
    border-top: 1px solid rgba(255, 92, 0, 0.1);
}

/* Estructura del panel de comentarios como flexbox */
.xioleni-comments-section {
    display: flex !important;
    flex-direction: column !important;
    height: 450px !important; /* Altura fija */
    max-height: 450px !important;
}

/* Fechas permanentemente visibles */
.xioleni-comment-date {
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.3s ease;
    position: absolute;
    right: 8px;
    top: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff !important;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 20;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 92, 0, 0.3);
}

/* Estilos para temas claros */
.xioleni-post[data-theme="light"] .xioleni-comment-date,
.xioleni-post[data-theme="medium-light"] .xioleni-comment-date {
    background: rgba(255, 255, 255, 0.95) !important;
    color: rgb(51, 51, 51) !important;
}

/* Las fechas ya son permanentemente visibles, no necesitan hover */

/* Reducir altura de los items de comentarios */
.xioleni-comment-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 92, 0, 0.2);
    border-radius: 8px;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    min-height: auto !important;
}

/* Expandir el post en móviles cuando tiene comentarios */
@media (max-width: 768px) {
    .xioleni-post:has(.xioleni-comments-section) {
        min-height: 550px !important;
        padding-bottom: 25px !important;
    }
    
    .xioleni-comments-section {
        padding: 15px !important;
        height: 500px !important;
        max-height: 500px !important;
    }
    
    .xioleni-comments-section .xioleni-comments-list {
        max-height: 340px !important;
        margin-top: -30px !important;
        margin-bottom: 0px !important;
        padding-bottom: 0px !important;
    }
    
    .xioleni-comment-form {
        flex-direction: column;
        gap: 12px;
        position: sticky;
        bottom: 0;
        background: inherit;
        padding: 20px 0 10px 0 !important;
        margin-top: auto !important;
        border-top: 1px solid rgba(255, 92, 0, 0.1);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .xioleni-comments-section .xioleni-comment-submit {
        align-self: flex-end;
        width: fit-content;
        padding: 10px 14px !important;
        font-size: 14px;
        color: #fff !important;
    }
    
    .xioleni-comment-input {
        padding: 15px !important;
        font-size: 16px;
    }
    
    /* Reducir más la altura en móvil */
    .xioleni-comment-item {
        padding: 6px 10px !important;
        margin-bottom: 6px !important;
    }
    
    .xioleni-comment-author {
        font-size: 13px !important;
        margin-bottom: 3px !important;
    }
    
    .xioleni-comment-text {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }
}

/* Animación de expansión suave */
.xioleni-comments-section.expanding {
    animation: xioleniCommentsExpand 0.3s ease-out forwards;
}

.xioleni-comments-section.collapsing {
    animation: xioleniCommentsCollapse 0.3s ease-in forwards;
}

@keyframes xioleniCommentsCollapse {
    0% {
        max-height: 400px;
        opacity: 1;
        padding: 20px;
    }
    100% {
        max-height: 0;
        opacity: 0;
        padding: 0 20px;
    }
}

/* Contador de caracteres */
.xioleni-char-counter {
    font-size: 11px;
    color: #aaa;
    padding: 5px 15px;
    text-align: left;
    background: inherit;
    border: none;
    margin: 0;
    margin-top: 5px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 15;
}

/* Temas específicos para el contador - fondos claros */
.xioleni-post[data-theme="light"] .xioleni-char-counter,
.xioleni-post[data-theme="medium-light"] .xioleni-char-counter {
    color: #333 !important;
}

/* Temas específicos para el contador - fondos oscuros */
.xioleni-post[data-theme="dark"] .xioleni-char-counter,
.xioleni-post[data-theme="medium-dark"] .xioleni-char-counter {
    color: #ccc !important;
}

/* Contenedor del contador eliminado - solo se usa en panel de comentarios */
