/* Just Doers color palette */
:root {
    --primary: #4dff7c;
    --primary-hover: #5fe889;
    --secondary: #00c4ff;
    --secondary-hover: #33ceff;
    --light: #e6fff0;
    --background-dark: #111827;
    --green: #4dff7c;
    --blue: #00c4ff;
    --red: #ff4d4d;
    --yellow: #ffdd57;
    
    /* Add aliases for backward compatibility */
    --odoo-primary: var(--primary);
    --odoo-primary-hover: var(--primary-hover);
    --odoo-light: var(--light);
}

/* Clear baseline styling to prevent conflicts */
header, nav, footer {
    background-color: transparent;
}

/* Make sure our custom classes override Tailwind */
.header-primary {
    background-color: var(--primary) !important;
    color: #1f2937 !important; /* gray-800 */
}

.header-primary * {
    color: #1f2937 !important; /* Ensure all text within header is dark */
}

.nav-secondary {
    background-color: var(--secondary) !important;
}

.nav-secondary * {
    color: white !important; /* Ensure all text within nav is white */
}

.nav-secondary a:hover {
    opacity: 0.9 !important;
    color: #f3f4f6 !important; /* gray-100 */
}

/* Fix the logout button specifically */
.header-primary a.nav-secondary {
    background-color: var(--secondary) !important;
    color: white !important;
}

.header-primary a.nav-secondary:hover {
    opacity: 0.9 !important;
}

/* Additional class for buttons using secondary color */
.btn-secondary {
    background-color: var(--secondary) !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover) !important;
}

/* Override Tailwind's inline styles with higher specificity */
[class*="bg-\[\#00c4ff\]"] {
    background-color: var(--secondary) !important;
}

[class*="hover\:bg-\[\#33ceff\]"]:hover {
    background-color: var(--secondary-hover) !important;
}

/* Override specific elements using legacy Odoo purple colors */
[class*="bg-\[\#714B67\]"], 
button[class*="bg-\[\#714B67\]"],
a[class*="bg-\[\#714B67\]"] {
    background-color: var(--secondary) !important;
}

[class*="hover\:bg-\[\#875A7B\]"]:hover,
button[class*="hover\:bg-\[\#875A7B\]"]:hover,
a[class*="hover\:bg-\[\#875A7B\]"]:hover {
    background-color: var(--secondary-hover) !important;
}

[class*="bg-\[\#875A7B\]"],
button[class*="bg-\[\#875A7B\]"],
a[class*="bg-\[\#875A7B\]"] {
    background-color: var(--secondary) !important;
}

[class*="hover\:bg-\[\#9D6A8A\]"]:hover,
button[class*="hover\:bg-\[\#9D6A8A\]"]:hover,
a[class*="hover\:bg-\[\#9D6A8A\]"]:hover {
    background-color: var(--secondary-hover) !important;
}

/* Fix specific colors with extra specificity - this is crucial */
nav[class*="bg-\[\#00c4ff\]"],
nav.nav-secondary,
nav.bg-blue-100 {
    background-color: var(--secondary) !important;
}

/* Force svg elements to use the right colors */
svg[class*="text-\[\#714B67\]"] {
    color: var(--secondary) !important;
}

/* Fix standard global elements */
.bg-blue-100 {
    background-color: var(--light) !important;
}

/* Target all action buttons to ensure they're blue */
button[id$="-filters"],
button[id^="toggle-"],
button[type="submit"],
button[id^="confirm-"] {
    background-color: var(--secondary) !important;
}

button[id$="-filters"]:hover,
button[id^="toggle-"]:hover,
button[type="submit"]:hover,
button[id^="confirm-"]:hover {
    background-color: var(--secondary) !important;
    opacity: 0.9;
}

/* Loading indicator needs specific fix */
.animate-spin[class*="text-\[\#714B67\]"] {
    color: var(--secondary) !important;
}

/* Map popup styling */
.leaflet-popup-content {
    margin: 10px 15px;
    line-height: 1.5;
}

.leaflet-popup-content h3 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: bold;
}

.leaflet-popup-content p {
    margin: 2px 0;
    font-size: 14px;
}

/* Lightbox transitions */
#lightbox {
    transition: opacity 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Multi-select styling */
select[multiple] {
    height: auto;
    min-height: 120px;
}

/* Error list styling */
#csv-errors-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    #map {
        height: 300px;
    }
    
    .lead-card {
        transition: transform 0.2s ease;
    }
    
    .lead-card:active {
        transform: scale(0.98);
    }
}

/* Table hover effects */
tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f9f5f8;
}

/* Button hover animation */
button {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10rem;
}

/* Loading animation */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

.pulse-animation {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Countdown timer styling */
.countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Notification animation */
@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    animation: slideIn 0.3s ease forwards;
}

/* Custom tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Fix for modal scrolling on mobile */
.modal-content {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Custom checkbox and radio styling */
input[type="checkbox"], input[type="radio"] {
    cursor: pointer;
}

input[type="checkbox"]:focus, input[type="radio"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Focus styles for better accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Tag styling */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1;
    background-color: var(--odoo-light);
    color: var(--odoo-primary);
}

/* Card hover effects */
.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Responsive table */
.responsive-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    white-space: normal;
}

/* Form control focus */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(77, 255, 124, 0.25); /* Using the green color */
}

/* Pagination active state */
.pagination-active {
    background-color: var(--primary);
    color: white;
}

/* Dropdown menu animation */
.dropdown-menu {
    animation: fadeIn 0.2s ease-out;
}

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

/* Placeholder image styling */
.placeholder-image {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

/* Override Tailwind classes with our custom colors */
[class*="bg-\[\#714B67\]"] {
    background-color: var(--primary) !important;
}

[class*="hover\:bg-\[\#875A7B\]"]:hover {
    background-color: var(--primary-hover) !important;
}

[class*="text-\[\#714B67\]"] {
    color: var(--primary) !important;
}

/* Apply custom colors to SVG elements */
svg[class*="text-\[\#714B67\]"] {
    color: var(--primary) !important;
}

/* Fix for color issues with specific elements */
.bg-blue-100 {
    background-color: var(--primary) !important;
}

[class*="bg-\[\#875A7B\]"] {
    background-color: var(--secondary) !important;
}

[class*="hover\:bg-\[\#9D6A8A\]"]:hover {
    background-color: var(--secondary) !important;
    opacity: 0.9;
}

/* Text color utility classes */
.text-secondary {
    color: var(--secondary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

/* Fix dashboard specific elements */
.stat-number {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 2.25rem;
    color: var(--secondary);
}

/* Add more specific override for dashboard icons */
svg[class*="text-\[\#714B67\]"],
[class*="text-\[\#714B67\]"] {
    color: var(--secondary) !important;
}

/* Styling for file upload button */
.file-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--secondary) !important;
    color: white !important;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-label:hover {
    background-color: var(--secondary-hover) !important;
}

.file-input {
    position: absolute;
    left: -9999px;
}

/* Fix modals appearing under map by increasing z-index */
#lead-detail-modal,
#feedback-modal,
#request-modal,
#lightbox {
    z-index: 1000 !important; /* Higher than Leaflet's z-index */
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
    z-index: 200 !important; /* Keep map components above regular content but below modals */
}

.leaflet-control {
    z-index: 800 !important; /* Keep controls above map but below modals */
}

.leaflet-popup {
    z-index: 900 !important; /* Keep popups above controls but below modals */
}

/* Fix button color issues on contacts page */
#add-contact-btn, 
#upload-contacts-btn,
#find-by-domain, 
#confirm-request, 
#apply-filters,
[class*="bg-\[\#00c4ff\]"], 
button[class*="bg-\[\#00c4ff\]"],
button[type="submit"][class*="bg-\[\#00c4ff\]"] {
    background-color: var(--secondary) !important;
    color: white !important;
}

#add-contact-btn:hover, 
#upload-contacts-btn:hover,
#find-by-domain:hover, 
#confirm-request:hover, 
#apply-filters:hover,
[class*="hover\:bg-\[\#33ceff\]"]:hover, 
button[class*="hover\:bg-\[\#33ceff\]"]:hover {
    background-color: var(--secondary-hover) !important;
    color: white !important;
}

/* Fix the email copy link color in contacts table */
.email-copy {
    color: var(--secondary) !important;
}

/* Fix LinkedIn profile links in contacts table */
[class*="text-\[\#00c4ff\]"], 
[class*="text-\[\#00c4ff\]"]:hover {
    color: var(--secondary) !important;
}

/* Delete button color fix */
.delete-contact, 
button.text-red-600 {
    color: #dc2626 !important; /* red-600 */
}

.delete-contact:hover, 
button.hover\:text-red-900:hover {
    color: #7f1d1d !important; /* red-900 */
}

/* Add styling for the toast notifications to ensure consistency */
#toast-notification {
    z-index: 1050 !important;
    transition: transform 0.3s ease;
}

/* Ensure all modals have proper z-index */
#add-contact-modal, 
#upload-contacts-modal, 
#quick-add-contact-modal {
    z-index: 1000 !important;
}

/* noUiSlider custom styling */
.noUi-connect {
    background: var(--secondary) !important; /* #00c4ff - matching the blue color */
}

.noUi-handle {
    background: var(--secondary) !important;
    border: 1px solid var(--secondary) !important;
    box-shadow: none !important;
}

.noUi-handle:before,
.noUi-handle:after {
    background: white !important;
}

.noUi-horizontal .noUi-handle:hover {
    background: var(--secondary-hover) !important; /* Slight color change on hover */
}

.noUi-target {
    border-color: #d1d5db !important; /* gray-300 */
    background-color: #e5e7eb !important; /* gray-200 */
}

#company-size-end {
    font-size: 0.75em;    
}

#company-size-start {
    font-size: 0.75em;    
}

/* Custom tag selector styling */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
}

.tag-item {
    display: flex;
    align-items: center;
    background-color: #f3f4f6;
    border-radius: 9999px;
    padding: 4px 12px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag-item.selected {
    background-color: var(--secondary);
    color: white;
}

.tag-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tag-item .tag-icon {
    margin-right: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Custom tag selector styling - Notion style */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: white;
    min-height: 42px;
    cursor: text;
    align-items: center;
    position: relative;
}

.tag-selector.focused {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(0, 196, 255, 0.1);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    background-color: #f3f4f6;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.875rem;
    margin-right: 4px;
    margin-bottom: 4px;
    transition: background-color 0.2s;
    user-select: none;
}

.tag-item.selected {
    background-color: var(--secondary);
    color: white;
}

.tag-item:hover {
    background-color: #e5e7eb;
}

.tag-item.selected:hover {
    background-color: var(--secondary-hover);
}

.tag-item .tag-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0.7;
    cursor: pointer;
}

.tag-item .tag-icon:hover {
    opacity: 1;
}

.tag-input {
    border: none;
    outline: none;
    flex-grow: 1;
    min-width: 60px;
    background-color: transparent;
    font-size: 0.875rem;
}

.tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    display: none;
    margin-top: 4px;
}

.tag-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.dropdown-item.selected {
    background-color: #e5e7eb;
}

.tag-placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
    position: absolute;
    left: 12px;
}

.tag-selector-wrapper {
    position: relative;
    width: 100%;
}


[class*="hover\:text-\[\#875A7B\]"]:hover, 
.hover\:text-\[\#875A7B\]:hover,
button.hover\:text-\[\#875A7B\]:hover, 
a.hover\:text-\[\#875A7B\]:hover {
    color: var(--secondary-hover) !important; /* #33ceff */
}

/* Ensure modal buttons and any other UI components use the new colors */
.modal-content button, 
.actions button,
#modal-feedback-btn,
#modal-request-btn,
#modal-close-btn {
    background-color: var(--secondary) !important;
    color: black !important;
}

.modal-content button:hover, 
.actions button:hover,
#modal-feedback-btn:hover,
#modal-request-btn:hover,
#modal-close-btn:hover {
    background-color: var(--secondary-hover) !important;
}

/* Set text color to black for secondary-colored buttons */
.btn-secondary,
[class*="bg-\[\#00c4ff\]"],
button[class*="bg-\[\#00c4ff\]"] {
    color: black !important;
}



