/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #e9eef5;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --success-color: #22c55e;
    --warning-color: #eab308;
}

/* Base styles */
html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* Header section */
.header-section {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.5rem 2rem 1rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
}
.header-left {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.header-left h1 {
    margin: 0;
    font-size: 2rem;
    color: #2c3e50;
    text-align: left;
}
.header-left .subtitle {
    margin: 0;
    color: #888;
    font-size: 1rem;
    text-align: left;
}
.header-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    max-width: 350px;
    overflow: visible;
}

/* Auth/User Info Styles */
.google-signin-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 4px;
    background: #fff;
    color: #444;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.15);
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s;
}
.google-signin-button:hover {
    background: #f1f3f4;
    box-shadow: 0 4px 8px rgba(60, 64, 67, 0.18);
}
.google-logo {
    width: 20px;
    height: 20px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.10);
}
.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
}
.user-photo:empty, .user-photo[src=""], .user-photo:not([src]) {
    background: #e0e0e0;
    content: '';
}
.user-name {
    font-weight: 500;
    color: #2c3e50;
    margin-right: 0.5rem;
}
.signout-button {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    padding: 0.2rem 0.7rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.signout-button:hover {
    background: #f1f3f4;
    color: #d32f2f;
}

/* Login Area Styles */
.login-area {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.login-box {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 0;
    max-width: 90vw;
    max-height: 90vh;
    box-sizing: border-box;
}
.login-prompt {
    text-align: center;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Dashboard Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px 32px;
    row-gap: 64px;
    align-items: stretch;
    margin-top: 2rem;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    margin-top: 5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Report Cards */
.dashboard-card, .report-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 160px;
    justify-content: flex-start;
}
.dashboard-card:hover, .report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--primary-color);
}
.dashboard-card h2, .report-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.dashboard-card p, .report-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.report-card p.event-description {
    font-size: 1.1rem !important;
    color: #111 !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    margin-top: 0.5em !important;
    line-height: 1.4 !important;
}

.card-footer {
    color: var(--primary-color);
    font-weight: 500;
    margin-top: auto;
}

/* Report Page Styles */
.back-links {
    margin-top: 0.5rem;
    display: flex;
    gap: 1.5rem;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: #217dbb;
    text-decoration: underline;
}

.report-container {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.report-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.report-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.subtext {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.refresh-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.refresh-button:hover {
    background-color: var(--primary-hover);
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-range-group {
    width: 100%;
    margin-top: 0.5rem;
}

.date-range-group #dateRangeSlider {
    margin: 1rem 0;
}

.date-range-values {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: white;
}

.date-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: white;
    color: var(--text-color);
    cursor: pointer;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Charts */
.chart-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--background-color);
    border-radius: var(--radius);
    min-height: 200px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background-color);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
}

/* Funnel Report Specific Styles */
.funnel-summary-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: var(--radius);
}

.funnel-total-box {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.funnel-total-box h3 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.funnel-total-box .funnel-count {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.funnel-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.funnel-summary-box {
    background: var(--card-background);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.funnel-summary-box h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.funnel-summary-box .funnel-count {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.funnel-summary-box .funnel-percentage {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Event Cards */
.event-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.event-cards .report-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    cursor: default;
}

.event-cards .report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text-color);
}

.event-cards .report-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.event-cards .report-card p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-cards .report-card p:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 500;
}

.event-cards .report-card p span {
    font-weight: 600;
    color: var(--text-color);
}

.event-cards .report-card p.event-hostname {
    font-size: 0.95rem !important;
    color: #444 !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    line-height: 1.3 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .report-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        min-width: unset;
    }
    
    .funnel-metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .funnel-total-box .funnel-count {
        font-size: 2rem;
    }
    
    .funnel-summary-box .funnel-count {
        font-size: 1.25rem;
    }
}

/* Event Details View */
.event-details-view {
    width: 100%;
    margin-top: 2rem;
}

.details-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: var(--background-color);
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr:hover {
    background-color: var(--background-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-button {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--background-color);
    border-color: var(--text-secondary);
}

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

.page-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--background-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.summary-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin: 0;
}

/* Funnel link styles */
.funnel-link {
    font-size: 0.95em;
    color: #888;
    margin-top: 0.25em;
}
.funnel-link a {
    color: #888;
    text-decoration: underline;
}

/* Month header for event grouping */
.month-header {
    grid-column: 1 / -1;
    margin: 2em 0 1em 0;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #eee;
    color: #333;
}

.nps-summary-table .cohort-label {
    background: #f1f5fa;
    color: #2563eb;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.15em 0.5em;
}

.gifts-summary-table,
.nps-summary-table {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}
.gifts-summary-table td,
.gifts-summary-table th,
.nps-summary-table td,
.nps-summary-table th {
    padding: 0.75rem 1.25rem !important;
    font-size: 1rem !important;
    line-height: 0.8 !important;
    margin: 0 !important;
    vertical-align: middle !important;
    height: 1px !important;
    border: none !important;
    overflow: hidden !important;
}

.gifts-summary-table td:first-child,
.nps-summary-table td:first-child {
    color: #64748b !important;
    font-size: 0.95rem;
    font-weight: 500;
    background: none;
    border-radius: 0;
    padding: 0.25rem 0.5rem 0.25rem 0;
}

.gifts-summary-table th,
.nps-summary-table th {
    color: #64748b !important;
    font-size: 0.95rem;
    font-weight: 500;
    font-style: normal !important;
}

.gifts-summary-table tbody td,
.gifts-summary-table thead th,
.nps-summary-table tbody td,
.nps-summary-table thead th {
    padding-top: 1.1rem !important;
    padding-bottom: 1.1rem !important;
}

.gifts-summary-table tbody td:nth-child(2),
.gifts-summary-table tbody td:nth-child(3),
.nps-summary-table tbody td:nth-child(2),
.nps-summary-table tbody td:nth-child(3) {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: var(--text-color) !important;
}

.event-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 0.75em 0;
}

/* Events page specific container */
.events-container {
    padding-left: 2rem;
}

/* Events page specific content */
.events-container #content {
    margin-left: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Add left margin to main content area on events page only */
.events-content-padding {
    margin-left: 2rem;
}

.revenue-content-padding {
    margin-left: 2rem;
    margin-right: 2rem;
}

.event-details-content-padding {
    margin-left: 2rem;
    margin-right: 2rem;
}

/* Dashboard content padding for index page, matching other pages */
.dashboard-content-padding {
    margin-left: 40px;
    margin-right: 40px;
}

@media (max-width: 800px) {
    .dashboard-content-padding {
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* --- Virality Page Enhancements --- */
.virality-content-padding {
    margin-left: 40px;
    margin-right: 40px;
    margin-top: 24px;
    margin-bottom: 24px;
}
@media (max-width: 800px) {
    .virality-content-padding {
        margin-left: 8px;
        margin-right: 8px;
    }
}

.summary-cards {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}
.summary-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 20px 32px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.summary-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #333;
}
.summary-card p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2a7cff;
}

/* Filter section improvements */
.filter-section {
    background: #f7f9fb;
    border-radius: 14px;
    padding: 28px 32px 18px 32px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    position: relative;
}
.filter-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2a7cff;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    align-items: flex-end;
    margin-bottom: 0;
}
.slider-container, .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e9eef3;
    border-radius: 8px;
    padding: 6px 12px;
}
.slider-container label, .checkbox-group span {
    font-size: 1rem;
    color: #444;
    font-weight: 500;
}
.slider-container span {
    min-width: 44px;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
    color: #2a7cff;
    font-weight: 600;
}
.filter-section select {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #c3d0e6;
    font-size: 1rem;
    background: #fff;
    margin-right: 8px;
}
@media (max-width: 900px) {
    .filter-section {
        padding: 18px 8px 10px 8px;
    }
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #f7f9fb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}
.data-table th, .data-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.97rem;
}
.data-table th {
    background: #e9eef3;
    color: #333;
    font-weight: 600;
}
.data-table tr:nth-child(even) {
    background: #f3f6fa;
}
.data-table tr:nth-child(odd) {
    background: #fff;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.pagination button {
    background: #2a7cff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination button:disabled {
    background: #b3c7e6;
    cursor: not-allowed;
}
.pagination span {
    font-size: 1.05rem;
    color: #333;
}

@media (max-width: 700px) {
    .summary-cards {
        flex-direction: column;
        gap: 12px;
    }
    .filter-section {
        flex-direction: column;
        gap: 10px;
        padding: 12px 8px 8px 8px;
    }
    .summary-card {
        width: 100%;
        min-width: unset;
        align-items: stretch;
    }
}

/* AI MM Chats page content padding */
.aimmchats-content-padding {
    margin-left: 40px;
    margin-right: 40px;
}
@media (max-width: 800px) {
    .aimmchats-content-padding {
        margin-left: 8px;
        margin-right: 8px;
    }
}
.aimmchats-content-padding .filter-row {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 18px;
}
.aimmchats-table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    background: #f7f9fb;
    border-radius: 10px;
}
.small-table-text {
    font-size: 0.92rem;
}
.data-table th, .data-table td {
    font-size: 0.92rem;
    padding: 7px 8px;
}

/* Wrap message text in AI MM Chats table and allow horizontal scrolling */
.aimmchats-message-cell {
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
    width: 320px;
}

/* Force table cell wrapping for AI MM Chats */
.data-table {
    /* table-layout: auto by default */
}

.user-row { cursor: pointer; }

/* AIMM Chats Group Alternating Colors */
.data-table tr.group-odd {
    background-color: #e9ecef;
}

.data-table tr.group-even {
    background-color: #ffffff;
}

.data-table tr.group-odd:hover {
    background-color: #dee2e6;
}

.data-table tr.group-even:hover {
    background-color: #f1f3f4;
}

/* AIMM Chats Summary Cards */
.aimmchats-content-padding .summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.aimmchats-content-padding .summary-card {
    background: var(--card-background);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.aimmchats-content-padding .summary-card h3 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aimmchats-content-padding .summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.aimmchats-content-padding .summary-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aimmchats-content-padding .message-types-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.aimmchats-content-padding .summary-breakdown {
    flex: 1;
}

.aimmchats-content-padding .pie-chart-container {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aimmchats-content-padding .breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.aimmchats-content-padding .breakdown-item:last-child {
    border-bottom: none;
}

.aimmchats-content-padding .breakdown-item .label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

.aimmchats-content-padding .breakdown-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

@media (max-width: 800px) {
    .aimmchats-content-padding .summary-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .aimmchats-content-padding .summary-value {
        font-size: 1.5rem;
    }
    
    .aimmchats-content-padding .message-types-container {
        flex-direction: column;
        align-items: center;
    }
    
    .aimmchats-content-padding .pie-chart-container {
        width: 150px;
        height: 150px;
    }
}

/* Retarget List specific styles */
.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.multi-select {
    min-width: 150px;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-height: 38px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    margin: 2px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fbbf24;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
}

.pagination-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--primary-hover);
}

.pagination-controls button:disabled {
    background: #b3c7e6;
    cursor: not-allowed;
}

.pagination-controls span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Enhanced Loading Spinner */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* Enhanced Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:disabled {
    background: #b3c7e6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-btn.current-page {
    background: var(--primary-hover);
    font-weight: 600;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 1rem;
    font-weight: 500;
}

/* Data container positioning for loading overlay */
.data-section {
    position: relative;
}

/* Table wrapper for horizontal scrolling */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    margin-bottom: 1rem;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

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

.table-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Ensure table doesn't shrink */
.data-table {
    min-width: 100%;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Page range indicator */
.page-range-indicator {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 0.25rem;
        padding: 0.75rem;
    }
    
    .pagination-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 36px;
        height: 32px;
    }
    
    .page-info {
        margin-left: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Users Leaving Events Page Specific Styles */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100vw; 
    height: 100vh; 
    overflow: auto; 
    background: rgba(0,0,0,0.4);
}

.modal-content { 
    background: #fff; 
    margin: 10% auto; 
    padding: 20px; 
    border: 1px solid #888; 
    width: 300px; 
    border-radius: 8px; 
    text-align: center;
}

.close { 
    color: #aaa; 
    float: right; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer;
}

.close:hover { 
    color: #000; 
}

.users-leaving-events-content-padding { 
    padding: 20px; 
}

.filters-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
    color: #212529;
}

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

/* Alternating User ID row colors */
.data-table tr[data-user-id] {
    transition: background-color 0.2s ease;
}

.data-table tr[data-user-id="even"] {
    background-color: #e8f4fd; /* Light blue instead of light gray */
}

.data-table tr[data-user-id="odd"] {
    background-color: #ffffff; /* White */
}

.data-table tr[data-user-id="even"]:hover {
    background-color: #d1ecf1;
}

.data-table tr[data-user-id="odd"]:hover {
    background-color: #f8f9fa;
}

.decision-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.decision-early-left {
    background: #fff3cd;
    color: #856404;
}

.decision-early-datee {
    background: #f8d7da;
    color: #721c24;
}

.decision-couple {
    background: #d4edda;
    color: #155724;
}

.decision-cut {
    background: #f8d7da;
    color: #721c24;
}

.decision-connect {
    background: #cce5ff;
    color: #004085;
}

.dated-yes {
    background: #d4edda;
    color: #155724;
    font-weight: 500;
}

.dated-no {
    background: #fff3cd;
    color: #856404;
    font-weight: 500;
}

.age-outside-range {
    background: #f8d7da;
    color: #721c24;
    font-weight: 500;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid #dee2e6;
}

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

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
}

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

.page-info {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.refresh-btn {
    padding: 8px 16px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.refresh-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.refresh-btn span {
    font-size: 16px;
}
