/* GoLead Custom Styles */

/* Sidebar navigation */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: all 0.15s ease;
}
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
}
.nav-link.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Sidebar submenu */
.nav-submenu-group .nav-link {
    margin-right: 0;
}
.sidebar-submenu .submenu-item {
    text-decoration: none;
}
.submenu-toggle svg {
    transition: transform 0.2s ease;
}
.submenu-toggle svg.rotate-180 {
    transform: rotate(180deg);
}

/* DataTables Tailwind overrides */
.dataTables_wrapper {
    font-size: 0.875rem;
}
.dataTables_wrapper .dt-top {
    background-color: #fafbfc;
}
.dataTables_wrapper .dataTables_length {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
}
.dataTables_wrapper .dataTables_length select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    font-size: 0.8125rem;
    outline: none;
    cursor: pointer;
}
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.dataTables_wrapper .dataTables_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
}
.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.15s;
    min-width: 200px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.625rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #374151;
    background: white;
    line-height: 1.25;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #4f46e5;
    border-color: #4f46e5;
    color: white !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.dataTables_wrapper .dataTables_info {
    font-size: 0.8125rem;
    color: #9ca3af;
}
.dataTables_wrapper .dataTables_processing {
    background: rgba(255,255,255,0.9) !important;
    border: none !important;
    z-index: 10;
}
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}
table.dataTable thead th {
    padding: 0.625rem 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    background-color: #fafbfc;
    white-space: nowrap;
    text-align: left !important;
}
table.dataTable thead th:first-child {
    padding-left: 1rem !important;
}
table.dataTable tbody td {
    padding: 0.625rem 1rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    vertical-align: middle;
    font-size: 0.875rem;
}
table.dataTable tbody tr {
    transition: background-color 0.1s;
}
table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}
table.dataTable tbody tr.selected {
    background-color: #eef2ff !important;
}
table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.modal-backdrop .modal-content {
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}
.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}
.status-badge:hover {
    opacity: 0.85;
}

/* Top bar follow-up pills */
.topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    background-color: #f9fafb;
    border: 1px solid #f3f4f6;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}
.topbar-pill:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}
.topbar-pill .topbar-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    background-color: #e5e7eb;
    color: #6b7280;
    line-height: 1;
}

/* Overdue pill active */
.topbar-pill-overdue.active {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.topbar-pill-overdue.active:hover {
    background-color: #fee2e2;
}
.topbar-pill-overdue.active .topbar-pill-count {
    background-color: #dc2626;
    color: white;
    animation: pulse-subtle 2s ease-in-out infinite;
}

/* Today pill active */
.topbar-pill-today.active {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.topbar-pill-today.active:hover {
    background-color: #dbeafe;
}
.topbar-pill-today.active .topbar-pill-count {
    background-color: #2563eb;
    color: white;
}

@keyframes pulse-subtle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* No-status badge */
.status-badge.no-status {
    background-color: transparent;
    color: #9ca3af;
    border: 1.5px dashed #d1d5db;
    font-size: 0.6875rem;
    padding: 0.2rem 0.5rem;
}
.status-badge.no-status:hover {
    border-color: #6366f1;
    color: #6366f1;
    background-color: #eef2ff;
}

/* Follow-up tags in table */
.followup-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.followup-tag.overdue {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.followup-tag.overdue:hover {
    background-color: #fee2e2;
}
.followup-tag.today {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}
.followup-tag.today:hover {
    background-color: #fef3c7;
}
.followup-tag.upcoming {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.followup-tag.upcoming:hover {
    background-color: #dcfce7;
}
.followup-tag.none {
    background-color: transparent;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
}
.followup-tag.none:hover {
    border-color: #6366f1;
    color: #6366f1;
    background-color: #eef2ff;
}

/* Follow-ups table bordered */
#followups-table tbody td {
    border: 1px solid #e5e7eb !important;
}
#followups-table thead th {
    border: 1px solid #e5e7eb !important;
}

/* Follow-up date cells */
.fup-date-cell.overdue .text-sm {
    color: #dc2626;
}
.fup-date-cell.today .text-sm {
    color: #d97706;
}
.fup-date-cell.upcoming .text-sm {
    color: #16a34a;
}

/* Follow-up row highlights */
table.dataTable tbody tr.fup-row-overdue {
    border-left: 3px solid #dc2626;
}
table.dataTable tbody tr.fup-row-today {
    border-left: 3px solid #f59e0b;
}

/* Follow-up tab cards */
.fup-tab-card {
    cursor: pointer;
}
.fup-tab-card:focus {
    outline: none;
}

/* Toast */
.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}
.toast-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.toast-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Kanban */
.kanban-column {
    min-height: 120px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.kanban-column::-webkit-scrollbar {
    width: 4px;
}
.kanban-column::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}
.kanban-column::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}
.kanban-card {
    cursor: grab;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.kanban-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.sortable-ghost {
    opacity: 0.3;
    border: 2px dashed #a5b4fc;
    background: #eef2ff;
    box-shadow: none;
}
.kanban-card.sortable-chosen {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: rotate(1deg);
    z-index: 100;
}
.kanban-card.sortable-drag {
    box-shadow: 0 20px 30px -5px rgba(0,0,0,0.15);
    transform: rotate(2deg);
    opacity: 0.95;
}
.kanban-drop-target {
    background-color: #f5f3ff !important;
    border: 2px dashed #c7d2fe;
    border-radius: 0.75rem;
}
/* Collapsed column */
.kanban-col-collapsed {
    width: 3rem !important;
    min-width: 3rem !important;
}
.kanban-col-collapsed .kanban-column,
.kanban-col-collapsed .kanban-load-more,
.kanban-col-collapsed .kanban-col-header > .flex:first-child > h3,
.kanban-col-collapsed .kanban-col-header > .flex:first-child > .col-count,
.kanban-col-collapsed .kanban-col-header > .flex:first-child > span:not(.col-count),
.kanban-col-collapsed .kanban-col-collapse {
    display: none;
}
.kanban-col-collapsed .kanban-col-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.25rem;
    cursor: pointer;
    border-left: none !important;
    border-bottom: 3px solid;
    border-bottom-color: inherit;
}
/* Lane settings dropdown animation */
#lane-settings-dropdown {
    animation: cardMenuIn 0.12s ease;
}
/* Card menu */
.card-menu {
    animation: cardMenuIn 0.12s ease;
}
@keyframes cardMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Kanban board horizontal scroll */
#kanban-board {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
#kanban-board::-webkit-scrollbar {
    height: 6px;
}
#kanban-board::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
#kanban-board::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Lead details HTML content */
.lead-details-html {
    line-height: 1.6;
    word-break: break-word;
}
.lead-details-html p { margin-bottom: 0.5em; }
.lead-details-html ul, .lead-details-html ol { padding-left: 1.5em; margin-bottom: 0.5em; }
.lead-details-html li { margin-bottom: 0.25em; }
.lead-details-html h1, .lead-details-html h2, .lead-details-html h3,
.lead-details-html h4, .lead-details-html h5, .lead-details-html h6 {
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #111827;
}
.lead-details-html a { color: #4f46e5; text-decoration: underline; }
.lead-details-html a:hover { color: #4338ca; }
.lead-details-html table { width: 100%; border-collapse: collapse; margin-bottom: 0.75em; font-size: 0.8125rem; }
.lead-details-html th, .lead-details-html td { border: 1px solid #e5e7eb; padding: 0.375rem 0.5rem; text-align: left; }
.lead-details-html th { background-color: #f9fafb; font-weight: 600; }
.lead-details-html img { max-width: 100%; height: auto; border-radius: 0.375rem; }
.lead-details-html blockquote { border-left: 3px solid #d1d5db; padding-left: 0.75em; color: #6b7280; margin: 0.5em 0; }
.lead-details-html pre, .lead-details-html code { background-color: #f3f4f6; border-radius: 0.25rem; font-size: 0.8125rem; }
.lead-details-html pre { padding: 0.75em; overflow-x: auto; }
.lead-details-html code { padding: 0.125em 0.25em; }
.lead-details-html hr { border: none; border-top: 1px solid #e5e7eb; margin: 0.75em 0; }

/* Checkbox styling */
.check-input {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1.5px solid #d1d5db;
    accent-color: #4f46e5;
}

/* Flatpickr overrides */
.flatpickr-calendar {
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Follow-up alarm bell animation */
.fup-alarm-ring {
    animation: alarmRing 0.5s ease-in-out infinite;
}
@keyframes alarmRing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Searchable Select */
.ss-wrapper {
    position: relative;
}
.ss-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 2.5rem;
    line-height: 1.25;
    color: #111827;
}
.ss-trigger:hover {
    border-color: #9ca3af;
}
.ss-trigger.ss-open {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.ss-trigger .ss-placeholder {
    color: #9ca3af;
}
.ss-trigger .ss-arrow {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    transition: transform 0.15s;
}
.ss-trigger.ss-open .ss-arrow {
    transform: rotate(180deg);
}
.ss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 70;
    display: none;
    overflow: hidden;
}
.ss-dropdown.ss-visible {
    display: block;
    animation: ssDropIn 0.12s ease;
}
@keyframes ssDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.ss-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.ss-search {
    width: 100%;
    padding: 0.375rem 0.625rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.15s;
}
.ss-search:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}
.ss-options {
    max-height: 180px;
    overflow-y: auto;
    padding: 0.25rem;
    scrollbar-width: thin;
}
.ss-option {
    padding: 0.4375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.1s;
    color: #374151;
}
.ss-option:hover {
    background-color: #f3f4f6;
}
.ss-option.ss-selected {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 500;
}
.ss-option.ss-hidden {
    display: none;
}
.ss-no-match {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}
.ss-add-new {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem;
    border-top: 1px solid #f3f4f6;
}
.ss-add-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.4375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #4f46e5;
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    text-align: left;
}
.ss-add-btn:hover {
    background-color: #eef2ff;
}
.ss-add-form {
    display: none;
    padding: 0.5rem;
    border-top: 1px solid #f3f4f6;
}
.ss-add-form.ss-active {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.ss-add-input {
    flex: 1;
    padding: 0.375rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    outline: none;
}
.ss-add-input:focus {
    border-color: #6366f1;
}
.ss-add-save {
    padding: 0.375rem 0.625rem;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.ss-add-save:hover {
    background: #4338ca;
}
