/* DataLeads Pro - Custom Styles */
html {
    scroll-behavior: smooth;
}

* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Autocomplete dropdowns */
.autocomplete-dropdown {
    position: absolute;
    z-index: 40;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
    margin-top: 2px;
}

.autocomplete-dropdown .ac-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
}

.autocomplete-dropdown .ac-item:hover {
    background: #eef2ff;
}

.autocomplete-dropdown .ac-item .ac-count {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Results table */
.results-table tbody tr {
    transition: background 0.1s;
}
.results-table tbody tr:hover {
    background: #f9fafb;
}
.results-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

/* Rating stars */
.rating-stars {
    color: #f59e0b;
    font-size: 0.75rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Filter shortcuts active state */
.filter-shortcut.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 500;
}

/* Sidebar relative for autocomplete positioning */
.search-field-wrapper {
    position: relative;
}

/* Mobile sidebar toggle */
@media (max-width: 1023px) {
    .sidebar-mobile-toggle {
        display: block;
    }
}

/* Pulse animation for quota warning */
.quota-warning {
    animation: pulse-warning 2s ease-in-out infinite;
}
@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Email masked style */
.email-masked {
    color: #9ca3af;
    font-style: italic;
    cursor: pointer;
}
.email-masked:hover::after {
    content: ' (plan supérieur requis)';
    font-size: 0.6875rem;
    color: #6366f1;
}

/* Listing detail modal */
.detail-field {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.detail-field-label {
    width: 140px;
    flex-shrink: 0;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.875rem;
}
.detail-field-value {
    color: #111827;
    font-size: 0.875rem;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Mobile: hide less important columns & detail field stacking */
@media (max-width: 640px) {
    .results-table thead th:nth-child(2),
    .results-table tbody td:nth-child(2),
    .results-table thead th:nth-child(6),
    .results-table tbody td:nth-child(6) {
        display: none;
    }
    .results-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }
    .results-table th {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Detail modal 2-column grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.detail-grid .detail-field {
    border-bottom: 1px solid #f3f4f6;
}
.detail-grid .detail-field.full-width {
    grid-column: 1 / -1;
}

/* Detail modal image */
.detail-hero-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Copy button inline */
.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
    line-height: 1.4;
}
.btn-copy:hover {
    background: #e0e7ff;
    color: #4338ca;
}
.btn-copy.copied {
    color: #059669;
    background: #d1fae5;
    border-color: #6ee7b7;
}

/* Category tags in detail modal */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    background: #f0f4ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
}

/* Detail description block */
.detail-description {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Google Maps button */
.btn-maps {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    background: #4285f4;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-maps:hover {
    background: #3367d6;
    color: #fff;
}

/* Detail modal close button bottom */
.btn-close-detail {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.btn-close-detail:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Detail rating display */
.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.detail-rating .rating-stars {
    font-size: 1rem;
}

@media (max-width: 640px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .detail-field {
        flex-direction: column;
    }
    .detail-field-label {
        width: auto;
        margin-bottom: 0.125rem;
    }
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
}
.badge-green {
    background: #dcfce7;
    color: #166534;
}
.badge-red {
    background: #fee2e2;
    color: #991b1b;
}
.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}
.badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* Recent searches sidebar */
.recent-search-item {
    border-radius: 0.5rem;
    transition: background 0.1s;
}
.recent-search-item:hover {
    background: #f9fafb;
}

/* Focus-visible accessibility styles */
*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Sort indicator styles */
.sort-indicator {
    font-size: 0.625rem;
    margin-left: 2px;
    vertical-align: middle;
}

/* Print styles */
@media print {
    nav,
    #sidebar,
    #sidebar-backdrop,
    .filter-shortcut,
    #export-btn,
    #toggle-advanced-btn,
    #pagination-buttons {
        display: none !important;
    }
    main {
        margin-left: 0 !important;
    }
    body {
        background: white !important;
    }
}
