/* Main Container */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #bae6fd 0%, #fbcfe8 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    height: 100%;
}

/* Stats Grid - MUST be horizontal in one row */
.stats-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.stat-card {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 20px 16px !important;
    background: white !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    border-top: 3px solid #667eea !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
}

/* Border colors for each card */
.stat-card:nth-child(1) {
    border-top-color: #667eea !important;
}

.stat-card:nth-child(2) {
    border-top-color: #10b981 !important;
}

.stat-card:nth-child(3) {
    border-top-color: #ef4444 !important;
}

.stat-card:nth-child(4) {
    border-top-color: #3b82f6 !important;
}

.stat-icon {
    font-size: 1.75rem !important;
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
}

.stat-card:nth-child(1) .stat-icon {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.15) !important;
}

.stat-card:nth-child(2) .stat-icon {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
}

.stat-card:nth-child(3) .stat-icon {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

.stat-card:nth-child(4) .stat-icon {
    color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.15) !important;
}

.stat-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.stat-label {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
}

.stat-value {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1 !important;
}

/* CLI text handling */
.cli-text {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.cli-text:hover {
    max-width: none;
    overflow: visible;
    white-space: normal;
}

/* Search Card - Used for all sections (Search, Stats, Results) */
.search-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid rgba(224, 242, 254, 0.5);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Form Grid and Form Groups */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tabs Container - Transparent like footer */
.tabs-container {
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.tabs {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    padding: 0 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1200px) {
    .tabs {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .tabs {
        padding: 0 16px;
    }

    .tab-btn {
        padding: 14px 20px;
        font-size: 14px;
        gap: 8px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .tabs {
        padding: 0 12px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
    }

    .tab-btn i {
        font-size: 14px;
    }
}

.tab-btn {
    padding: 18px 30px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.loading-spinner,
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    color: #6c757d;
}

/* No Results Message */
.no-results-message {
    text-align: center;
}

.no-results-content {
    padding: 60px 30px;
}

.no-results-content i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 20px;
}

.no-results-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.no-results-content p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination-controls button {
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table styling */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.results-table tbody tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-primary {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Buttons */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

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

/* Button Group - Search and Clear on same line */
.button-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    margin-top: 20px !important;
}

.button-group button {
    flex: 0 0 auto !important;
    padding: 10px 24px !important;
}

/* Results Header - Fix Export CSV alignment */
.results-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
}

.results-header h3 {
    margin: 0 !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
}

.btn-export {
    background: white !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-export:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1000px;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Call details sections */
.call-detail-section {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    background: #f9fafb;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.section-header:hover {
    background: #f3f4f6;
}

.section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.section-toggle {
    font-size: 1.25rem;
    color: #6b7280;
    transition: transform 0.2s;
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 16px;
    background: white;
}

.section-content.collapsed {
    display: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.875rem;
    color: #111827;
    font-weight: 500;
}

.detail-value.empty {
    color: #9ca3af;
    font-style: italic;
}

.audio-player-large {
    margin-top: 12px;
}

.audio-player-large audio {
    width: 100%;
}

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

    .modal-content {
        width: 95%;
        margin: 10px auto;
    }
}

/* Minimal Details button styling - no layout changes */
.btn-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.btn-details:hover {
    opacity: 0.9;
}

/* Duplicate modal definition removed - using the one at line 474 */

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    padding: 0;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Enhanced modal sections */
.call-detail-section {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    background: #f9fafb;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f3f4f6;
}

.section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.section-toggle {
    font-size: 1rem;
    color: #6b7280;
    transition: transform 0.2s;
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    padding: 16px;
    background: white;
}

.section-content.collapsed {
    display: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.875rem;
    color: #111827;
    font-weight: 500;
}

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

/* ============================================================================
   RESPONSIVE LAYOUT - COMPREHENSIVE
   ============================================================================ */

/* Table responsive wrapper */
.results-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

.results-table {
    min-width: 1200px;
    width: 100%;
}

@media (max-width: 1400px) {
    .results-table-wrapper {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }
}

/* Search form responsive */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

@media (max-width: 1200px) {
    .search-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .search-grid {
        gap: 10px;
    }
}

/* Button groups */
.search-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.search-actions button {
    flex: 0 0 auto;
    min-width: 120px;
}

@media (max-width: 640px) {
    .search-actions {
        flex-direction: column;
    }

    .search-actions button {
        width: 100%;
    }
}

/* Stats grid truly responsive */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin: 20px 0 !important;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

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

/* Modal responsive */
.modal-content {
    width: 90% !important;
    max-width: 800px !important;
    margin: 2% auto !important;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        margin: 5% auto !important;
        max-height: 90vh !important;
    }

    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-header h2 {
        font-size: 1.1rem !important;
    }
}

/* Section header responsive */
.section-header h3 {
    font-size: 1rem;
}

@media (max-width: 640px) {
    .section-header h3 {
        font-size: 0.9rem;
    }

    .section-header {
        padding: 10px 12px;
    }
}

/* Export CSV button consistency */
.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-export i {
    font-size: 16px;
}

/* Ensure buttons are consistent */
button.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}


/* Fix search container layout */
.search-container {
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
}

/* Fix search fields grid */
.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .search-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Fix button positioning */
.search-actions,
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 20px;
    width: 100%;
}

.search-actions button,
.button-group button {
    min-width: 100px;
    padding: 10px 20px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .search-actions,
    .button-group {
        flex-direction: row;
        gap: 8px;
    }

    .search-actions button,
    .button-group button {
        flex: 1 1 auto;
        min-width: 80px;
    }
}


/* Fix modal padding */
.modal-body {
    padding: 20px !important;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 16px !important;
    }
}

/* Fix modal content padding */
#aircallDetailsContent {
    padding: 0;
}

#aircallDetailsContent > div {
    padding: 0;
}

/* Ensure sections have proper spacing */
.call-detail-section {
    margin-bottom: 16px;
}

.section-content {
    padding: 16px;
}


/* Stronger table responsive rules */
.results-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 20px 0 !important;
    display: block !important;
}

.results-table {
    width: 100% !important;
    min-width: 1200px !important;
    border-collapse: collapse !important;
}

/* On small screens, show horizontal scroll clearly */
@media (max-width: 1400px) {
    .results-table-wrapper {
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        background: white !important;
    }

    .results-table-wrapper::after {
        content: "â† Scroll to see more â†’";
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 12px;
        color: #6b7280;
        background: #f9fafb;
    }
}

@media (max-width: 768px) {
    .results-table {
        font-size: 13px !important;
        min-width: 1000px !important;
    }

    .results-table th,
    .results-table td {
        padding: 8px 10px !important;
    }

    .results-table-wrapper {
        margin: 16px -16px !important;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .results-table {
        font-size: 12px !important;
        min-width: 900px !important;
    }

    .results-table th,
    .results-table td {
        padding: 6px 8px !important;
    }

    .results-table-wrapper {
        margin: 12px -12px !important;
    }
}


/* Ensure results containers don't overflow */
#aircallResults,
#vicidialResults {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin: 20px 0 !important;
}

/* Results header with export button */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 640px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* Remove problematic scroll indicator */
.results-table-wrapper::after {
    display: none !important;
}

/* Better scroll indication - shadow gradient */
.results-table-wrapper {
    position: relative;
    background: linear-gradient(90deg, white 0%, transparent 10%, transparent 90%, white 100%);
}


/* Ensure header stays visible */
header,
.header,
.page-header,
.main-header {
    position: relative !important;
    z-index: 100 !important;
    background: white !important;
    display: block !important;
}

/* Tab navigation should stay visible - Transparent */
.tabs,
.tab-navigation,
.nav-tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
}

/* Ensure search section stays visible */
.search-section {
    position: relative !important;
    z-index: 10 !important;
    display: block !important;
    visibility: visible !important;
}

/* Fix any hidden overflow issues */
body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .container {
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }
}

/* Tab Content */
.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.main-container,
.content {
    overflow: visible !important;
}


/* Better scroll behavior */
.results-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 20px 0 !important;
    /* Remove position relative if it's causing issues */
    position: static !important;
}

/* Ensure table is always scrollable */
.results-table-wrapper table {
    display: table !important;
    min-width: 1200px !important;
}

/* Visual scroll hint with border only */
@media (max-width: 1400px) {
    .results-table-wrapper {
        border: 2px solid #667eea !important;
        border-radius: 8px !important;
        padding: 4px !important;
    }
}


/* ============================================================================
   PAGE HEADER - FORCE VISIBILITY
   ============================================================================ */

/* Ensure page header always visible - Transparent */
.page-header,
header.main-header,
div[class*="header"] {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* If header has specific styling - Transparent */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

/* Header content */
.header-content,
.header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 24px !important;
    width: 100% !important;
}

/* Prevent any parent from hiding header */
body > *:first-child,
.app-container > *:first-child,
.main-container > *:first-child {
    display: block !important;
    visibility: visible !important;
}

/* User info section */
.user-info,
.header-right,
[class*="user"] {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}


/* Prevent body from hiding content */
html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    height: 100% !important;
}

body {
    display: block !important;
    visibility: visible !important;
}

/* Main container should not hide overflow vertically */
.container,
.main-container,
.app-container,
main {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100% !important;
}

/* Content wrapper */
.content-wrapper,
.content,
main > div {
    overflow: visible !important;
}


/* ============================================================================
   HEADER LAYOUT FIX - ENSURE BOTH SIDES VISIBLE
   ============================================================================ */

header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 16px 24px !important;
    background: white !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Left side - logo/title */
header > div:first-child,
header .header-left,
header h1 {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
}

/* Right side - user info */
header > div:last-child,
header .header-right,
header .user-section {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

/* User info text */
.user-info,
#user-info,
[id*="user"] {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Logout button */
button[onclick*="logout"],
a[onclick*="logout"],
.logout-btn,
#logout-btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 8px 16px !important;
    cursor: pointer !important;
}

/* Responsive header */
@media (max-width: 640px) {
    header {
        padding: 12px 16px !important;
    }

    header > div:first-child,
    header h1 {
        font-size: 1.1rem !important;
    }
}




/* Transcript button styling */
.btn-transcript {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-transcript:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-transcript i {
    font-size: 1rem;
}


/* Fix ViciDial table width */
#vicidial-tab .results-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

#vicidialResultsTable {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
}

#vicidialResultsTable th,
#vicidialResultsTable td {
    padding: 10px 12px;
    white-space: nowrap;
}

/* Allow phone numbers and some columns to wrap */
#vicidialResultsTable td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    max-width: 150px;
}


/* Transcript button styling */
.btn-transcript {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-transcript:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ViciDial table width fix */
#vicidial-tab .results-table-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* ViciDial table matches Aircall exactly */
#vicidialResultsTable {
    width: 100%;
    table-layout: auto;
}

#vicidialResults .table-wrapper {
    width: 100%;
    overflow-x: auto;
}

#vicidialResults .results-table-wrapper {
    width: 100%;
}

#vicidialResultsTable {
    width: 100%;
    max-width: 100%;
}

/* Results Section - Inside search-card */
.results-section {
    padding: 0;
    margin-top: 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.btn-export {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Comparable Header - Transparent like Footer */
.comparable-header {
    background: transparent !important;
    backdrop-filter: blur(20px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2) !important;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background;
}

.comparable-header.scrolled {
    background: transparent !important;
    backdrop-filter: blur(25px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(25px) saturate(1.3) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.25) !important;
}

.comparable-header.collapsed {
    background: transparent !important;
    backdrop-filter: blur(25px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(25px) saturate(1.3) !important;
    padding: 6px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.comparable-header.collapsed .header-container {
    padding: 4px 32px;
}

.comparable-header.collapsed .header-logo {
    height: 32px;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comparable-header.collapsed .header-divider {
    display: none;
}

.comparable-header.collapsed .header-title {
    display: none;
}

.comparable-header.collapsed .user-info-text {
    display: none;
}

.comparable-header.collapsed .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comparable-header.collapsed .user-menu-arrow {
    display: none;
}

.comparable-header.collapsed .user-profile-btn {
    padding: 4px 8px;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 1200px) {
    .header-container {
        padding: 16px 24px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
    }

    .comparable-header.collapsed .header-container {
        padding: 6px 16px;
        gap: 8px;
    }

    /* Ensure header elements don't overflow */
    .header-left,
    .header-right {
        max-width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 10px 12px;
    }

    .comparable-header.collapsed .header-container {
        padding: 4px 12px;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

@media (max-width: 1200px) {
    .header-left {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .header-left {
        gap: 8px;
        flex: 1 1 100%;
        order: 1;
    }
}

@media (max-width: 480px) {
    .header-left {
        gap: 6px;
    }
}

.header-logo {
    height: 44px;
    width: auto;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .header-logo {
        height: 36px;
    }

    .comparable-header.collapsed .header-logo {
        height: 28px;
    }
}

.header-divider {
    width: 1px;
    height: 36px;
    background: #e5e7eb;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .header-title {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .header-title {
        font-size: 16px;
    }

    .header-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 14px;
    }

    .header-logo {
        height: 32px;
    }

    .comparable-header.collapsed .header-logo {
        height: 24px;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .header-right {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .header-right {
        gap: 8px;
        flex: 0 0 auto;
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .header-right {
        gap: 6px;
    }
}

/* User Profile Button */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .user-profile-btn {
        padding: 4px 8px;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .user-profile-btn {
        padding: 3px 6px;
        gap: 4px;
    }
}

.user-profile-btn:hover {
    background: #f9fafb;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);
}

@media (max-width: 768px) {
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.user-info-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (max-width: 768px) {
    .user-info-name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .user-info-name {
        font-size: 11px;
    }
}

.user-menu-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.user-profile-btn.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-wrapper {
    position: relative;
}

/* User Menu */
.user-menu-wrapper {
    position: relative;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.user-badge:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    line-height: 1.2;
}

.user-menu-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s;
}

.user-badge.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid #e5e7eb;
    display: none !important;
    overflow: hidden;
}

.user-menu-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    color: #667eea;
    padding-left: 20px;
}

.user-menu-item i {
    width: 18px;
    color: #6b7280;
    font-size: 14px;
    transition: color 0.2s ease;
}

.user-menu-item:hover i {
    color: #667eea;
}

.user-menu-item span {
    flex: 1;
}

/* Comparable Branded Footer */
.comparable-footer {
    background: transparent;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    padding: 30px 0;
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
}

.comparable-footer .footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    text-align: center;
}

.comparable-footer .footer-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.comparable-footer .footer-text strong {
    color: #1f2937;
    font-weight: 600;
}

/* Search form content - collapsible */
.search-form-content {
    display: block;
}

/* Toggle Buttons for Search/Stats/Results */
.search-toggle-btn,
.section-toggle-btn {
    background: transparent;
    border: 2px solid #e9ecef;
    color: #667eea;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.search-toggle-btn:hover,
.section-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* Responsive Header/Footer */
@media (max-width: 768px) {
    .header-main-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .header-branding {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .user-badge {
        flex: 1;
    }

    .comparable-footer .footer-text {
        font-size: 12px;
    }
}

