/* Lead Dashboard Styles - Modern Email/Lead Management Interface */

.lead-dashboard {
    min-height: 100vh;
    background-color: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.header-actions .btn:hover {
    background: #2563eb;
}

.header-actions .btn-secondary {
    background: #6b7280;
    color: white;
    margin-right: 0.5rem;
}

.header-actions .btn-secondary:hover {
    background: #4b5563;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.filter-btn i {
    font-size: 0.875rem;
}

.filter-group {
    position: relative;
}

/* Tag Dropdown */
.tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    min-width: 200px;
    margin-top: 0.25rem;
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.tag-option:hover {
    background: #f8fafc;
}

.tag-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.tag-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-label.red {
    color: #dc2626;
}

.tag-label.orange {
    color: #ea580c;
}

.tag-label.blue {
    color: #2563eb;
}

.tag-label.gray {
    color: #6b7280;
}

/* Data Table */
.data-table-container {
    padding: 2rem;
    background: white;
    margin: 0 2rem 2rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.data-table th.sortable:hover {
    background: #f1f5f9;
}

.data-table th.sortable i {
    margin-left: 0.5rem;
    opacity: 0.5;
    font-size: 0.75rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.orange {
    background: #fed7aa;
    color: #9a3412;
}

.status-badge.green {
    background: #bbf7d0;
    color: #166534;
}

.status-badge.red {
    background: #fecaca;
    color: #991b1b;
}

.status-badge.gray {
    background: #f3f4f6;
    color: #6b7280;
}

/* Company Cell */
.company-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.company-cell i {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Tags Cell */
.tags-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag.red {
    background: #fef2f2;
    color: #dc2626;
}

.tag.orange {
    background: #fff7ed;
    color: #ea580c;
}

.tag.blue {
    background: #eff6ff;
    color: #2563eb;
}

.tag.gray {
    background: #f9fafb;
    color: #6b7280;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filters-bar {
        padding: 1rem;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .data-table-container {
        margin: 0 1rem 1rem 1rem;
        padding: 1rem;
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.5rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        justify-content: space-between;
    }

    .data-table-container {
        margin: 0 0.5rem 0.5rem 0.5rem;
        padding: 0.5rem;
    }
}

/* Animation for dropdown */
.tag-dropdown {
    animation: slideDown 0.2s ease-out;
}

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

/* Hover effects */
.data-table tbody tr {
    transition: background-color 0.2s;
}

.filter-btn {
    transition: all 0.2s ease;
}

.status-badge {
    transition: all 0.2s ease;
}

.tag {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
.filter-btn:focus,
.data-table th.sortable:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar for table container */
.data-table-container::-webkit-scrollbar {
    height: 8px;
}

.data-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
