/* Main Container */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
}

/* Stats Grid - MUST be horizontal in one row */
.stats-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin: 20px 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;
}

/* 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: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.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;
}

.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;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    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;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.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: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
}

/* 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: 14px !important;
    }

    .results-table th,
    .results-table td {
        padding: 8px 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 */
.tabs,
.tab-navigation,
.nav-tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: white !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,
.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 */
.page-header,
header.main-header,
div[class*="header"] {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: white !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* If header has specific styling */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !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 */

.main-container,
.app-container,
main {
    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;
    }
}


/* FORCE header to display horizontally */
header,
header > div:first-child,
header > div:last-child {
    display: flex !important;
    flex-direction: row !important;
}

header {
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 24px !important;
}

header > div:first-child {
    flex: 0 0 auto !important;
    margin-right: auto !important;
}

header > div:last-child {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    gap: 16px !important;
}

/* Ensure user info and button are inline */
#user-info,
button[onclick*="logout"] {
    display: inline-block !important;
    white-space: nowrap !important;
}


/* NUCLEAR OPTION - Force header horizontal */
body > header,
body > div > header,
header[style] {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

body > header > div,
body > div > header > div,
header > div {
    display: flex !important;
    align-items: center !important;
}

body > header > div:first-child,
body > div > header > div:first-child,
header > div:first-child {
    flex: 0 0 auto !important;
    margin-right: auto !important;
}

body > header > div:last-child,
body > div > header > div:last-child,
header > div:last-child {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    gap: 16px !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;
}

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




/* =================================================================
   ISSUE 4 FIX FINAL: ViciDial Results Layout Consistency
   Fixed: 2026-02-05 - Match Aircall's contained width
   ================================================================= */

/* Main container should have max-width (if not already) */
.container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 30px !important;
}

/* Ensure both results sections stay within container bounds */
.results-section,
.results-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 25px !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* Table containers must allow horizontal scroll but not break layout */
.table-container,
.table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 20px 0 !important;
}

/* ViciDial table specific - force minimum width for all columns */
#vicidialResultsTable {
    width: 100% !important;
    min-width: 1200px !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
}

/* Prevent text wrapping in table cells */
#vicidialResultsTable th,
#vicidialResultsTable td {
    white-space: nowrap !important;
    padding: 10px 12px !important;
}

/* Allow phone number column to wrap if very long */
#vicidialResultsTable td:nth-child(2) {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 150px !important;
}

/* Visual scroll hint on narrow screens */
@media (max-width: 1400px) {
    .table-container {
        border: 2px solid #667eea !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2) !important;
    }
}

/* Responsive: container padding on mobile */
@media (max-width: 768px) {
    .container {
        padding: 15px !important;
    }

    .results-section,
    .results-card {
        padding: 15px !important;
    }
}

/* End Issue 4 Fix Final */
