/**
 * RSVPKit Public Dashboard Styles
 */

/* ==========================================================================
   CRITICAL: Override theme CSS that causes select text to be clipped/hidden
   ========================================================================== */
.rsvpkit-public-dashboard select,
.rsvpkit-public-dashboard .rsvpkit-filter-select,
.rsvpkit-public-dashboard .rsvpkit-filter-group select,
.rsvpkit-public-dashboard .rsvpkit-per-page-select,
body .rsvpkit-public-dashboard select {
    height: auto !important;
    min-height: 40px !important;
    max-height: none !important;
    padding: 10px 35px 10px 14px !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    color: #374151 !important;
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 10px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
}

.rsvpkit-public-dashboard select:focus,
.rsvpkit-public-dashboard .rsvpkit-filter-select:focus,
.rsvpkit-public-dashboard .rsvpkit-filter-group select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

/* ==========================================================================
   END Critical Override Rules
   ========================================================================== */

/* Container and Layout */
.rsvpkit-public-dashboard {
    padding: 40px 20px;
    max-width: 1400px;
    /* Increased from 1200px for better desktop table display */
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    /* Prevent OS dark mode auto-theming of native controls */
    color-scheme: light;
}

.rsvpkit-dashboard-container {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* Header */
.rsvpkit-dashboard-header {
    /* Color is set via inline style from PHP settings */
    padding: 40px 30px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 30px;
}

.rsvpkit-dashboard-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: inherit;
}

.rsvpkit-dashboard-header h2 {
    margin: 0 0 15px 0;
    font-size: 1.8rem;
    font-weight: 500;
    opacity: 0.95;
    color: inherit;
}

.rsvpkit-dashboard-description {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    color: inherit;
}

/* Modern Stats Grid - Single Row Layout */
.rsvpkit-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    padding: 0;
}

.rsvpkit-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rsvpkit-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent-color);
    border-radius: 16px 16px 0 0;
}

.rsvpkit-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #e5e7eb;
}

.rsvpkit-stat-card.total {
    --card-accent-color: #3b82f6;
}

.rsvpkit-stat-card.attending {
    --card-accent-color: #10b981;
}

.rsvpkit-stat-card.not-attending {
    --card-accent-color: #ef4444;
}

.rsvpkit-stat-card.guests {
    --card-accent-color: #8b5cf6;
}

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

.rsvpkit-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-accent-color);
    color: white;
    flex-shrink: 0;
    /* Reset theme interference */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Stat icon SVG styling */
.rsvpkit-stat-icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    /* Reset theme interference */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
    background: transparent !important;
    display: block !important;
}

.rsvpkit-stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f0fdf4;
    color: #16a34a;
}

.rsvpkit-stat-change.negative {
    background: #fef2f2;
    color: #dc2626;
}

.rsvpkit-stat-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rsvpkit-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin: 0;
}

.rsvpkit-stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.rsvpkit-stat-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Notices */
.rsvpkit-notice {
    padding: 15px 30px;
    margin: 0;
    border-left: 4px solid;
    font-weight: 500;
}

.rsvpkit-notice-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.rsvpkit-notice-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Modern Filters */
/* Dashboard Filters */
.rsvpkit-dashboard-filters {
    margin-bottom: 30px;
}

.rsvpkit-filters-container {
    max-width: 1400px;
    /* Match main dashboard container width */
    margin: 0 auto;
    padding: 0;
}

.rsvpkit-filter-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.rsvpkit-filter-title {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.rsvpkit-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: end;
}

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

.rsvpkit-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rsvpkit-filter-label,
.rsvpkit-filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.rsvpkit-filter-label svg,
.rsvpkit-filter-group label svg {
    color: #6b7280;
    width: 14px;
    height: 14px;
}

.rsvpkit-filter-input,
.rsvpkit-filter-select,
.rsvpkit-filter-group input,
.rsvpkit-filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
    font-weight: 400;
    box-sizing: border-box;
}

.rsvpkit-filter-input:focus,
.rsvpkit-filter-select:focus,
.rsvpkit-filter-group input:focus,
.rsvpkit-filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.rsvpkit-filter-input::placeholder,
.rsvpkit-filter-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Modern Messages Container */
.rsvpkit-messages-container {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.rsvpkit-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 4px;
}

.rsvpkit-messages-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.rsvpkit-messages-title svg {
    color: #3b82f6;
}

.rsvpkit-messages-count {
    display: flex;
    align-items: center;
}

.rsvpkit-count-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.rsvpkit-messages-table-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.rsvpkit-messages-table {
    width: 100%;
}

/* Modern Table Layout */
.rsvpkit-response-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.rsvpkit-response-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
}

.rsvpkit-response-table th {
    padding: 20px 24px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.rsvpkit-response-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.rsvpkit-response-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.001);
}

.rsvpkit-response-table tbody tr:last-child {
    border-bottom: none;
}

.rsvpkit-response-table td {
    padding: 20px 24px;
    vertical-align: top;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Handle long text in table cells (Name column is 3rd td) */
.rsvpkit-response-table td:nth-child(3) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

/* Email column (4th td) - also truncate */
.rsvpkit-response-table td:nth-child(4) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Message column (8th td) - wrap text */
.rsvpkit-response-table td:nth-child(8) {
    max-width: 200px;
    word-break: break-word;
    white-space: normal;
}

.rsvpkit-response-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    margin-bottom: 4px;
}

.rsvpkit-response-email {
    color: #6b7280;
    font-size: 0.875rem;
}

.rsvpkit-response-message {
    max-width: 300px;
    line-height: 1.6;
    color: #4b5563;
}

.rsvpkit-response-message.empty {
    color: #9ca3af;
    font-style: italic;
}

.rsvpkit-response-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rsvpkit-response-status.attending {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.rsvpkit-response-status.not-attending {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.rsvpkit-response-guests {
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

.rsvpkit-response-date {
    color: #6b7280;
    font-size: 0.875rem;
    white-space: nowrap;
}

.rsvpkit-response-actions {
    text-align: center;
}

.rsvpkit-delete-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rsvpkit-delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: scale(1.1);
}

/* Message Cards */
.rsvpkit-message-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rsvpkit-message-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.rsvpkit-message-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.rsvpkit-message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rsvpkit-message-info {
    flex: 1;
    min-width: 0;
}

.rsvpkit-message-name {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.rsvpkit-message-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

.rsvpkit-message-date,
.rsvpkit-message-guests {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rsvpkit-message-actions {
    flex-shrink: 0;
}

.rsvpkit-delete-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvpkit-delete-btn:hover {
    background: #f8d7da;
    color: #dc3545;
}

.rsvpkit-message-content {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.rsvpkit-message-content p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

.rsvpkit-message-status {
    margin-top: 15px;
}

.rsvpkit-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Attendance Status Badge - Modern Minimalist Style */
.rsvpkit-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.rsvpkit-status-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    /* Reset theme interference */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.rsvpkit-status-attending {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.rsvpkit-status-not-attending,
.rsvpkit-status-not_attending {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* No Messages State */
.rsvpkit-no-messages {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.rsvpkit-no-messages-icon {
    margin-bottom: 24px;
    opacity: 0.7;
}

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

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

/* Table Controls */
.rsvpkit-table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.rsvpkit-showing-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rsvpkit-per-page-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.rsvpkit-per-page-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.rsvpkit-showing-text {
    font-size: 14px;
    color: #666;
}

/* Pagination Styles */
.rsvpkit-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rsvpkit-pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsvpkit-pagination-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

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

.rsvpkit-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rsvpkit-pagination-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsvpkit-pagination-number:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.rsvpkit-pagination-number.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.rsvpkit-pagination-dots {
    padding: 0 8px;
    color: #94a3b8;
    font-weight: 500;
}

/* Footer */
.rsvpkit-dashboard-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    text-align: center;
}

.rsvpkit-dashboard-footer p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.rsvpkit-dashboard-footer a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.rsvpkit-dashboard-footer a:hover {
    text-decoration: underline;
}

/* Table Header Container */
.rsvpkit-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    gap: 12px;
}

/* Table header actions container */
.rsvpkit-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Export CSV Button */
.rsvpkit-export-csv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--rsvpkit-export-btn-bg, #10b981) 0%, var(--rsvpkit-export-btn-bg-2, #059669) 100%);
    color: var(--rsvpkit-export-btn-text, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    margin-bottom: 20px;
}

.rsvpkit-table-header .rsvpkit-export-csv {
    margin-bottom: 0;
    /* no extra space when inside header */
}

.rsvpkit-export-csv:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--rsvpkit-export-btn-hover-bg, #059669) 0%, var(--rsvpkit-export-btn-hover-bg-2, #047857) 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.rsvpkit-export-csv:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Bulk delete trigger button state */
.rsvpkit-bulk-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rsvpkit-dashboard-container {
        padding: 15px;
    }

    .rsvpkit-dashboard-header h1 {
        font-size: 24px;
    }

    /* Stats Grid - Stack on mobile */
    .rsvpkit-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .rsvpkit-stat-card {
        padding: 20px 15px;
    }

    .rsvpkit-stat-number {
        font-size: 24px;
    }

    .rsvpkit-stat-label {
        font-size: 12px;
    }

    /* Stack title and export on mobile */
    .rsvpkit-table-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    /* Filter Section */
    .rsvpkit-filter-section {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }

    .rsvpkit-filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .rsvpkit-filter-group label {
        margin-bottom: 5px;
    }

    /* Table - Horizontal scroll */
    .rsvpkit-messages-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rsvpkit-response-table {
        min-width: 600px;
        font-size: 14px;
    }

    .rsvpkit-response-table th,
    .rsvpkit-response-table td {
        padding: 10px 8px;
    }

    /* Table Controls */
    .rsvpkit-table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .rsvpkit-showing-info {
        justify-content: center;
        text-align: center;
    }

    /* Pagination - Stack buttons */
    .rsvpkit-pagination {
        justify-content: center;
    }

    .rsvpkit-pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .rsvpkit-pagination-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* Modal */
.rsvpkit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.rsvpkit-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.rsvpkit-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.rsvpkit-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.rsvpkit-modal-close:hover {
    color: #dc3545;
}

.rsvpkit-modal-body {
    padding: 30px;
}

.rsvpkit-form-group {
    margin-bottom: 20px;
}

.rsvpkit-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.rsvpkit-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.rsvpkit-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.rsvpkit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background: var(--rsvpkit-btn-bg, #667eea);
    color: var(--rsvpkit-btn-text, #ffffff);
}

.rsvpkit-btn:hover:not(:disabled) {
    background: var(--rsvpkit-btn-hover-bg, #5a67d8);
    transform: translateY(-1px);
}

/* Bulk Delete Button - uses danger colors */
.rsvpkit-bulk-delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.rsvpkit-bulk-delete-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.rsvpkit-bulk-delete-btn:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
    box-shadow: none;
}

.rsvpkit-btn-secondary {
    background: #6c757d;
    color: white;
}

.rsvpkit-btn-secondary:hover {
    background: #5a6268;
}

.rsvpkit-btn-danger {
    background: #dc3545;
    color: white;
}

.rsvpkit-btn-danger:hover {
    background: #c82333;
}

/* No Results */
.rsvpkit-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.rsvpkit-no-results p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rsvpkit-public-dashboard {
        padding: 10px;
    }

    .rsvpkit-dashboard-header {
        padding: 30px 20px;
    }

    .rsvpkit-dashboard-header h1 {
        font-size: 2rem;
    }

    .rsvpkit-dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .rsvpkit-stat-card {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .rsvpkit-stat-card:nth-child(odd) {
        border-right: 1px solid #e9ecef;
    }

    .rsvpkit-stat-card:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .rsvpkit-dashboard-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .rsvpkit-filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .rsvpkit-filter-group input,
    .rsvpkit-filter-group select {
        min-width: auto;
    }

    .rsvpkit-messages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .rsvpkit-message-header {
        gap: 12px;
    }

    .rsvpkit-message-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .rsvpkit-message-meta {
        flex-direction: column;
        gap: 5px;
    }

    .rsvpkit-modal {
        padding: 10px;
    }

    .rsvpkit-modal-header,
    .rsvpkit-modal-body {
        padding: 20px;
    }

    .rsvpkit-form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .rsvpkit-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Compact card padding specifically for phones */
    .rsvpkit-stat-card {
        padding: 10px;
    }

    .rsvpkit-showing-info {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        text-align: center;
        width: 100%;
    }

    .rsvpkit-pagination-btn span {
        display: none;
    }

    .rsvpkit-dashboard-stats {
        grid-template-columns: 1fr;
    }

    .rsvpkit-stat-card {
        border-right: none;
    }

    .rsvpkit-stat-card:nth-child(odd) {
        border-right: none;
    }

    .rsvpkit-dashboard-header h1 {
        font-size: 1.8rem;
    }

    .rsvpkit-dashboard-description {
        font-size: 1rem;
    }
}

/* Responses Table Scroll Container */
.rsvpkit-responses-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Desktop: Remove horizontal scroll for wide screens */
@media (min-width: 1200px) {
    .rsvpkit-responses-table-container {
        overflow-x: visible;
    }
}

.rsvpkit-guest-responses-section {
    overflow: hidden;
}

/* Desktop: Allow overflow visible */
@media (min-width: 1200px) {
    .rsvpkit-guest-responses-section {
        overflow: visible;
    }
}

.rsvpkit-response-table {
    min-width: 720px;
}

/* Dark Mode Support (opt-in via .rsvpkit-enable-dark) */
@media (prefers-color-scheme: dark) {
    .rsvpkit-enable-dark .rsvpkit-dashboard-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .rsvpkit-enable-dark .rsvpkit-dashboard-stats {
        background: #2d2d2d;
    }

    .rsvpkit-enable-dark .rsvpkit-stat-card {
        border-color: #404040;
    }

    .rsvpkit-enable-dark .rsvpkit-stat-card:hover {
        background: #333333;
        border-color: #555555;
    }

    .rsvpkit-enable-dark .rsvpkit-stat-number {
        color: #e0e0e0;
    }

    .rsvpkit-enable-dark .rsvpkit-dashboard-filters {
        background: #1a1a1a;
        border-color: #404040;
    }

    .rsvpkit-enable-dark .rsvpkit-filter-group input,
    .rsvpkit-enable-dark .rsvpkit-filter-group select {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }

    .rsvpkit-enable-dark .rsvpkit-messages-container {
        background: #1a1a1a;
    }

    .rsvpkit-enable-dark .rsvpkit-message-card {
        background: #2d2d2d;
        border-color: #404040;
    }

    .rsvpkit-enable-dark .rsvpkit-message-name {
        color: #e0e0e0;
    }

    .rsvpkit-enable-dark .rsvpkit-message-content {
        background: #333333;
    }

    .rsvpkit-enable-dark .rsvpkit-message-content p {
        color: #c0c0c0;
    }

    .rsvpkit-enable-dark .rsvpkit-modal-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .rsvpkit-enable-dark .rsvpkit-modal-header {
        border-color: #404040;
    }

    .rsvpkit-enable-dark .rsvpkit-form-group input {
        background: #333333;
        border-color: #404040;
        color: #e0e0e0;
    }
}

/* Cross-Page Display Notice */
.rsvpkit-cross-page-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #fef9e7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.1);
}

.rsvpkit-cross-page-notice strong {
    color: #856404;
    font-weight: 600;
}

/* Dashboard Body Styling */
.rsvpkit-dashboard-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 10px;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    /* Prevent OS dark mode auto-theming of native controls */
    color-scheme: light;
}

.rsvpkit-dashboard-body * {
    box-sizing: border-box;
}

/* Messages Header Actions */
.rsvpkit-messages-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rsvpkit-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.rsvpkit-export-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.rsvpkit-export-btn svg {
    width: 16px;
    height: 16px;
}

/* Table Column Widths */
.rsvpkit-col-number {
    width: 60px;
    text-align: center;
}

.rsvpkit-col-guest {
    width: 200px;
}

.rsvpkit-col-message {
    width: 300px;
}

.rsvpkit-col-status {
    width: 120px;
}

.rsvpkit-col-guests {
    width: 80px;
    text-align: center;
}

.rsvpkit-col-source {
    width: 150px;
}

.rsvpkit-col-date {
    width: 120px;
}

.rsvpkit-col-actions {
    width: 80px;
    text-align: center;
}

/* Row Number Styling */
.rsvpkit-response-number {
    text-align: center;
    padding: 20px 12px;
}

.rsvpkit-row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
}

/* Table Footer */
.rsvpkit-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
    gap: 20px;
}

.rsvpkit-per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #64748b;
}

.rsvpkit-per-page-select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.rsvpkit-per-page-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rsvpkit-pagination-info {
    font-size: 0.875rem;
    color: #64748b;
}

.rsvpkit-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rsvpkit-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rsvpkit-pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

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

.rsvpkit-pagination-pages {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Footer */
.rsvpkit-dashboard-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 32px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.rsvpkit-dashboard-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.rsvpkit-dashboard-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.rsvpkit-dashboard-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rsvpkit-table-footer {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .rsvpkit-per-page-selector {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .rsvpkit-pagination {
        justify-content: center;
    }

    /* Footer segments should stack and center on mobile */
    .rsvpkit-footer-left,
    .rsvpkit-footer-right {
        width: 100%;
        text-align: center;
    }

    .rsvpkit-footer-right {
        justify-content: center;
    }

    .rsvpkit-messages-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .rsvpkit-export-btn {
        justify-content: center;
    }
}

/* Source Post Styling */
.rsvpkit-response-source {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsvpkit-response-source.current-source {
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.rsvpkit-response-source.linked-source {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.rsvpkit-response-source .source-indicator {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Selected Events Badges */
.rsvpkit-selected-events {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.rsvpkit-event-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.rsvpkit-event-badge:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    transform: translateY(-1px);
}

/* Message Cell & View Button */
.rsvpkit-message-cell {
    position: relative;
    padding-right: 28px;
    /* Space for icon */
    min-height: 40px;
}

.rsvpkit-message-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    word-break: break-word;
}

.rsvpkit-view-message-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.rsvpkit-message-cell:hover .rsvpkit-view-message-btn {
    opacity: 1;
}

.rsvpkit-view-message-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    opacity: 1;
}

.rsvpkit-view-message-btn svg {
    width: 14px;
    height: 14px;
    color: #6b7280;
    stroke: currentColor;
}

.rsvpkit-view-message-btn:hover svg {
    color: #374151;
}

/* Message Modal */
.rsvpkit-message-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.rsvpkit-message-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: rsvpkit-modal-appear 0.3s ease;
}

@keyframes rsvpkit-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.rsvpkit-message-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

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

.rsvpkit-message-modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.rsvpkit-message-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.rsvpkit-message-modal-body p {
    margin: 0;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    word-wrap: break-word;
}