/* Small lead count cards above the kanban */
.lead-mini-cards .card {
  border-radius: 8px;
}
.lead-mini-cards .card-body {
  padding: 6px 10px !important;
}
.lead-mini-cards .badge {
  font-size: 12px;
}
.lead-mini-cards strong.small {
  font-weight: 700;
}

.kanban-board {
    border: none;
    background-color: #FFFFFFAA;
    box-shadow: 0 1px 3px 0 rgba(69, 90, 100, 0.1);
    border-radius: 10px;
}

.kanban-board .kanban-drag {
    min-height: 80vh!important;
    padding: 10px!important;
}

.kanban-board header {
    padding: 10px!important;
    border-bottom: none!important;
}

.kanban-item {
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 0.5px solid #efefef;
    background-color: #fff;
    box-shadow: 0 0px 10px 0 rgba(69, 90, 100, 0.1);
}

.kanban-item.kanban-age-today {
    /* border: 2px solid #ffc107; */
    border-left: 3px solid var(--bs-primary);
}

.kanban-item.kanban-age-week {
    /* border: 1.5px solid #ffc10788; */
    /* border: 1px solid #ffc107; */
    border-left: 2px solid var(--bs-primary);
}

.kanban-item.kanban-age-month {
    /* border: 1px solid #ffc10744; */
    border-left: 0.5px solid var(--bs-primary);
}

.kanban-container {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 300px);
    /* width: calc(100% - 250px); */
    min-width: calc(100vw - 250px);
}
.kanban-column {
    min-width: 300px;
    width: 300px;
    margin-right: 1rem;
    height: 100%;
}
.kanban-column-header {
    padding: 0.75rem;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
}
.kanban-column-body {
    background-color: #f8f9fa;
    border-radius: 0 0 0.25rem 0.25rem;
    padding: 0.75rem;
    min-height: 200px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}
.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin: 0;
    padding: 0.75rem;
    width: 100%;
}

.kanban-count-badge {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    margin-right: 5px;
}

.kanban-card {
    background-color: white;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
}
.kanban-card:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.kanban-card-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.kanban-card-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}
.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}
.kanban-add-card {
    display: block;
    text-align: center;
    padding: 0.5rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    margin-top: 0.75rem;
    color: #495057;
    text-decoration: none;
}
.kanban-add-card:hover {
    background-color: #dee2e6;
}

.dropdown-menu {
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
}

.dropdown-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.btn-outline-secondary {
    border-color: #e9ecef;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.tag-filter-label:hover {
    opacity: 0.8;
}

.badge {
    /* font-size: 0.75rem; */
    padding: 0.25rem 0.5rem;
}

.dropdown-item.period-option.active, .dropdown-item.created-period-option.active {
    background-color: #0d6efd;
    color: white;
}

.dropdown-item.period-option.active:hover, .dropdown-item.created-period-option.active:hover {
    background-color: #0b5ed7;
    color: white;
}

/* Fix Select2 dropdown z-index in offcanvas */
.select2-container--default .select2-dropdown {
    z-index: 1075 !important; /* Bootstrap offcanvas z-index is 1045 */
}

.select2-container--default .select2-dropdown--above {
    z-index: 1075 !important;
}

.select2-container--default .select2-dropdown--below {
    z-index: 1075 !important;
}

/* Ensure select2 dropdown appears over offcanvas backdrop */
.offcanvas + .select2-container .select2-dropdown {
    z-index: 1075 !important;
}

/* Centralize kanban loading overlay */
.kanban-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--tblr-secondary-rgb), 0.8);
    z-index: 10;
}

.kanban-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.kanban-container {
    position: relative;
    min-height: 400px;
}

/* Select2 customization for stage and origin selects in offcanvas */
#modalMemberStageSelect + .select2-container,
#modalMemberOriginSelect + .select2-container {
    width: 100% !important;
    max-width: 350px !important;
    display: block !important;
    z-index: 9999 !important;
}

.select2-container--default .select2-dropdown {
    z-index: 9999 !important; /* Ensure dropdown appears over offcanvas */
}

.select2-container--default .select2-dropdown--above {
    z-index: 9999 !important;
}

.select2-container--default .select2-dropdown--below {
    z-index: 9999 !important;
}

/* Ensure select2 dropdown appears over offcanvas backdrop */
#funnelLeadPanel .select2-container .select2-dropdown {
    z-index: 9999 !important;
}

/* Debug info styles */
.debug-info-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.debug-info-content {
    background-color: #f8f9fa;
}

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

.toggle-debug-info:hover i {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* Action info styles */
.action-info-container {
    animation: slideDown 0.3s ease-out;
}

.action-info-content {
    background-color: #f8f9fa;
}

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

.toggle-action-info:hover i {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* Error info styles */
.error-info-container {
    animation: slideDown 0.3s ease-out;
}

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

.error-info-content {
}

.error-item {
    transition: all 0.2s;
}

.error-item:hover {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.toggle-error-info {
    transition: all 0.2s;
    cursor: pointer;
}

.toggle-error-info:hover i {
    transform: scale(1.2);
}

details summary {
    user-select: none;
    outline: none;
}

details summary::-webkit-details-marker {
    color: #dc3545;
}

.conversation-container {
    height: calc(100vh - 140px); /* Ajustar baseado na altura do header */
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

.conversation-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.conversation-actions {
    flex-shrink: 0;
}

.conversations-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-area {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0; /* Importante para flexbox */
}

.chat-input {
    background-color: #F9F9F9BB !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px;
    max-height: 40px;
}

.chat-input input, .chat-input input:hover, .chat-input input:focus, .chat-input textarea, .chat-input textarea:hover, .chat-input textarea:focus {
    /* border: none!important;
    background: none; */
    resize: none;
}

.chat-input .attachment-icon {
    left: 36px;
}


.new-contact-form {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
    display: none;
    flex-shrink: 0;
}

.new-contact-form.show {
    display: block;
}

.conversation-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.conversation-item:hover {
    background-color: #f8f9fa;
}

.conversation-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.chat-history {
    white-space: pre-wrap;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* Garantir que o scroll funcione em mobile */
@media (max-width: 768px) {
    .conversation-container {
        height: calc(100vh - 120px);
    }
    
    .conversations-list {
        max-height: none;
    }
}

/* Estilos existentes */
.kanban-board-header {
    height: auto !important;
    padding: 15px 10px !important;
}

.kanban-title-board {
    font-weight: bold;
}

.kanban-container {
    padding-bottom: 0px !important;
}

.kanban-board {
    overflow-y: auto !important; 
    max-height: 80vh !important;
    overflow-x: hidden !important;
}

.kanban-board-header .dropdown {
    float: right;
}

.kanban-item .badge {
    font-size: 11px;
    margin-top: 0.5rem;
}

.kanban-item .card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.kanban-item .card-text {
    margin-bottom: 0.3rem;
}

.kanban-container .card-body small {
    color: #6c757d;
}

.lead-item-phone, .lead-item-email {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.collapse-icon {
    transition: transform 0.3s;
    display: inline-block;
}

#chatHistoryToggle[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

#leadCaptureFormToggle[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

/* Novos estilos para os campos do lead capture form */
.lead-field-value {
    display: block;
    padding: 0.375rem 0;
    min-height: 1.5rem;
}

.lead-field-wrapper {
    position: relative;
}

#editLeadFormBtn {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
}

/* Estilo para placeholder quando campo está vazio */
.lead-field-value:empty::after {
    content: "—";
    color: #aaa;
    font-style: italic;
}

/* Fix z-index for tags modal to appear above lead details modal */
#tagsModal {
    z-index: 1060 !important;
}

#tagsModal .modal-backdrop {
    z-index: 1059 !important;
}

/* Ensure Select2 dropdown appears above everything */
.select2-container--open .select2-dropdown {
    z-index: 1061 !important;
}

/* Fix for Select2 in modal */
.select2-container {
    width: 100% !important;
}