/* SISTEMA DE COMENTARIOS - DISEÑO MODERNO Y SUTIL */

.comments-section {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.comments-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.comments-title i {
    color: #3b82f6;
    font-size: 1.1rem;
}

.comments-count {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* FORMULARIO DE COMENTARIO */
.comment-form {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

/* BOTÓN PARA DESPLEGAR FORMULARIO */
.comment-form-toggle {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-form-toggle-btn {
    width: 100%;
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.comment-form-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.comment-form-toggle-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.comment-form-toggle-btn:hover i {
    transform: scale(1.1);
}

/* FORMULARIO COLAPSADO */
.comment-form.collapsed {
    display: none !important;
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.comment-form.expanding {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    max-height: none !important;
    overflow: visible !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-bottom: 2rem;
}

.comment-form.collapsing {
    display: block !important;
    opacity: 0 !important;
    transform: translateY(-10px) !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.comment-form-container {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.comment-form-container:focus-within {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    background: transparent;
    border: none;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.comment-textarea::placeholder {
    color: rgba(107, 114, 128, 0.7);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.comment-char-count {
    font-size: 0.8rem;
    color: rgba(107, 114, 128, 0.8);
}

.comment-char-count.warning {
    color: #ff9800;
}

.comment-char-count.error {
    color: #f44336;
}

.comment-submit-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.comment-submit-btn.loading {
    pointer-events: none;
}

.comment-submit-btn.loading i {
    animation: spin 1s linear infinite;
}

/* MENSAJE PARA USUARIOS NO AUTENTICADOS */
.comment-auth-prompt {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 1.5rem 2rem;
    text-align: center;
}

.comment-auth-prompt p {
    color: #ffc107;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.comment-login-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    color: #0a0a0f;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

/* LISTA DE COMENTARIOS */
.comments-list {
    padding: 0 1.5rem;
}

.comment-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.5s ease;
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    flex-shrink: 0;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: rgba(107, 114, 128, 0.8);
}

.comment-content {
    color: #374151;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
}

/* ESTADO VACÍO */
.comments-empty {
    text-align: center;
    padding: 1.5rem;
    color: rgba(107, 114, 128, 0.8);
}

.comments-empty i {
    font-size: 2.5rem;
    color: rgba(107, 114, 128, 0.4);
    margin-bottom: 0.75rem;
    display: block;
}

.comments-empty h3 {
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.comments-empty p {
    font-size: 0.85rem;
}

/* LOADING STATE */
.comments-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 0.75rem;
    color: rgba(107, 114, 128, 0.8);
}

.comments-loading i {
    animation: spin 1s linear infinite;
    color: #3b82f6;
}

/* ANIMACIONES */
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes expandForm {
    0% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.9);
        max-height: 0;
    }
    50% {
        opacity: 0.5;
        max-height: 250px;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 500px;
    }
}

@keyframes collapseForm {
    0% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 500px;
    }
    50% {
        opacity: 0.5;
        max-height: 250px;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.9);
        max-height: 0;
    }
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .comments-section {
        margin-top: 2rem;
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1.5rem 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .comments-header {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .comments-count {
        order: 2;
        margin-left: auto;
    }
    
    .comments-title {
        order: 1;
        font-size: 1.1rem;
    }
    
    .comment-form,
    .comment-form-toggle,
    .comments-list,
    .comment-auth-prompt {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .comment-textarea {
        min-height: 80px;
        font-size: 0.9rem;
    }
    
    .comment-form-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .comment-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .comment-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.75rem;
        position: relative;
    }
    
    .comment-author {
        flex: 1;
        gap: 0.75rem;
    }
    
    .comment-author-info {
        flex: 1;
    }
    
    .comment-delete-btn {
        position: absolute;
        top: 0;
        right: 0;
        padding: 0.5rem;
        margin: -0.25rem;
    }
}

@media (max-width: 480px) {
    .comments-section {
        margin-top: 1.5rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding: 1rem 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .comments-header {
        padding: 0 0.75rem;
    }
    
    .comment-form,
    .comment-form-toggle,
    .comments-list,
    .comment-auth-prompt {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .comment-form-container,
    .comment-item {
        padding: 1rem;
    }
    
    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .comments-empty {
        padding: 2rem 1rem;
    }
    
    .comments-empty i {
        font-size: 2.5rem;
    }
}

/* TEMA OSCURO MEJORADO */
@media (prefers-color-scheme: dark) {
    .comments-section {
        background: linear-gradient(135deg, rgba(5, 5, 10, 0.9) 0%, rgba(15, 15, 25, 0.95) 100%);
    }
    
    .comment-form-container,
    .comment-item {
        background: rgba(255, 255, 255, 0.02);
        border-color: rgba(255, 255, 255, 0.05);
    }
    
    .comment-form-container:focus-within,
    .comment-item:hover {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* INTEGRACIÓN CON EL DISEÑO EXISTENTE */
.evento-detalle-page .comments-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* EFECTOS ADICIONALES */
.comment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-item:hover::before {
    opacity: 0.7;
}

/* BOTÓN DE ELIMINAR COMENTARIO */
.comment-delete-btn {
    background: none;
    border: none;
    color: rgba(107, 114, 128, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    opacity: 1;
    transform: scale(1);
}

.comment-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.comment-delete-btn.loading {
    pointer-events: none;
    opacity: 0.5;
}

.comment-delete-btn.loading i {
    animation: spin 1s linear infinite;
}

/* SCROLL PERSONALIZADO PARA COMENTARIOS LARGOS */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

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

.comments-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

/* PAGINACIÓN INFINITA */
.comments-load-more {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    margin-top: 1rem;
}

.comments-load-more-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-load-more-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.comments-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.comments-load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

.comments-end-message {
    text-align: center;
    padding: 1.5rem;
    color: rgba(107, 114, 128, 0.6);
    font-size: 0.85rem;
    font-style: italic;
}

/* BOTÓN CANCELAR */
.comment-cancel-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-cancel-btn:hover {
    background: #e5e7eb;
    border-color: rgba(0, 0, 0, 0.2);
}