/* Participant Stats */
.wxgiveaway-participant-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.wxgiveaway-participant-stat-box {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.wxgiveaway-participant-stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
    color: white;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: bold;
}

/* Participant Grid */
.wxgiveaway-participant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Participant Card */
.participant-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Changed from hidden to visible */
    z-index: 1;
}

.participant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
    z-index: 10; /* Higher z-index on hover */
}

/* Participant Avatar */
.participant-avatar {
    flex-shrink: 0;
    margin-right: 15px;
}

.participant-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #667eea;
    object-fit: cover;
}

/* Participant Info */
.participant-info {
    flex: 1;
    min-width: 0;
}

.participant-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-orders,
.participant-tickets {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.info-label {
    font-weight: 600;
    color: #333;
    margin-right: 5px;
}

.order-numbers {
    color: #667eea;
}

/* Ticket Section */
.participant-tickets {
    position: relative;
}

.ticket-count {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-left: 5px;
}

.view-tickets-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.view-tickets-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.view-tickets-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Ticket Numbers Dropdown */
.ticket-numbers-list {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1000; /* Very high z-index */
    margin-top: 5px;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ticket-numbers-list.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Ticket numbers grid layout for better visibility */
.ticket-numbers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.ticket-number {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

.ticket-number:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Scrollbar styling for ticket list */
.ticket-numbers-list::-webkit-scrollbar {
    width: 8px;
}

.ticket-numbers-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ticket-numbers-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.ticket-numbers-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Participant Badge */
.participant-badge {
    flex-shrink: 0;
    margin-left: 15px;
}

.ticket-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

/* No Participants Message */
.wxgiveaway-no-participants {
    text-align: center;
    padding: 50px 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.wxgiveaway-no-participants p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Load More Button */
.wxgiveaway-load-more {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wxgiveaway-participant-stats {
        flex-direction: column;
        gap: 10px;
    }

    .wxgiveaway-participant-grid {
        grid-template-columns: 1fr;
    }

    .participant-card {
        flex-wrap: wrap;
    }

    .participant-badge {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        text-align: center;
    }

    .ticket-badge {
        width: 100%;
        text-align: center;
    }

    /* Adjust ticket dropdown for mobile */
    .ticket-numbers-list {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
        z-index: 9999;
    }

    .ticket-numbers-list.show {
        transform: translate(-50%, -50%);
    }

    /* Add overlay for mobile */
    body.tickets-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
}

@media (max-width: 480px) {
    .participant-card {
        flex-direction: column;
        text-align: center;
    }

    .participant-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .participant-info {
        width: 100%;
    }

    .participant-tickets .view-tickets-btn {
        display: block;
        margin: 10px auto 0;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.participant-card {
    animation: slideIn 0.5s ease forwards;
}

/* Human Icon Fallback */
.participant-avatar img[src*="d=mp"] {
    position: relative;
}

/* Hover Effects */
.participant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.participant-card:hover::before {
    transform: scaleX(1);
}

.close-tickets-btn {
    background: none;
    border: none;
    color: gray;
    outline: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-tickets-btn:hover {
    opacity: 1;
}

.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================================================================
   WXGiveaway — Template Two: Table View
   Add these rules to your existing participant-list-tab.css
================================================================ */

/* ── Wrapper ── */
.wxgiveaway-participant-table-wrap {
    margin-top: 20px;
    font-family: inherit;
}

/* ── Search Bar ── */
.wxgiveaway-table-search-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.wxgiveaway-search-input-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wxgiveaway-ticket-search-input {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wxgiveaway-ticket-search-input:focus {
    border-color: #7a4af0;
    box-shadow: 0 0 0 3px rgba(122, 74, 240, 0.12);
}

.wxgiveaway-ticket-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #7a4af0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.wxgiveaway-ticket-search-btn:hover {
    background: #6336d6;
}

.wxgiveaway-ticket-search-btn:active {
    transform: scale(0.97);
}

.wxgiveaway-ticket-search-reset {
    padding: 10px 14px;
    background: transparent;
    color: #777;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.wxgiveaway-ticket-search-reset:hover {
    background: #f5f5f5;
    color: #333;
}

.wxgiveaway-search-status {
    font-size: 13px;
    color: #888;
    min-height: 18px;
}

.wxgiveaway-search-status.wxgiveaway-status-error {
    color: #c0392b;
}

.wxgiveaway-ticket-search-input.wxgiveaway-input-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* ── Table Container ── */
.wxgiveaway-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Table ── */
.wxgiveaway-participant-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}

.wxgiveaway-participant-table thead tr {
    background: #f7f4ff;
    border-bottom: 2px solid #e0d7ff;
}

.wxgiveaway-participant-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: #5a3db8;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.wxgiveaway-participant-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.wxgiveaway-participant-table tbody tr:last-child {
    border-bottom: none;
}

.wxgiveaway-participant-table tbody tr:hover {
    background: #faf8ff;
}

.wxgiveaway-participant-table tbody td {
    padding: 12px 16px;
    color: #333;
    vertical-align: middle;
}

/* Column widths */
.wxgiveaway-participant-table .col-index {
    width: 50px;
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.wxgiveaway-participant-table .col-ticket {
    min-width: 130px;
}

.wxgiveaway-participant-table .col-name {
    min-width: 150px;
}

.wxgiveaway-participant-table .col-date {
    min-width: 110px;
    white-space: nowrap;
    color: #666;
}

.wxgiveaway-participant-table .col-order {
    min-width: 100px;
}

/* Ticket badge */
.wxga-ticket-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #f0ebff;
    color: #6336d6;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Order ID badge */
.wxga-order-id {
    display: inline-block;
    padding: 3px 9px;
    background: #f0f7ff;
    color: #2563a8;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Loading / Empty / Error States ── */
.wxgiveaway-table-loading-row td,
.wxgiveaway-table-no-results,
.wxgiveaway-table-error {
    text-align: center;
    padding: 32px 16px !important;
    color: #888;
    font-size: 14px;
}

.wxgiveaway-table-error {
    color: #c0392b;
}

.wxgiveaway-table-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    font-size: 14px;
}

/* Spinner */
.wxgiveaway-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e0d7ff;
    border-top-color: #7a4af0;
    border-radius: 50%;
    animation: wxga-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes wxga-spin {
    to { transform: rotate(360deg); }
}

/* ── Pagination ── */
.wxgiveaway-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 4px;
}

.wxgiveaway-pagination-info {
    font-size: 13px;
    color: #888;
}

.wxgiveaway-pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Prev / Next buttons */
.wxgiveaway-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.wxgiveaway-page-btn:hover:not(:disabled) {
    background: #f7f4ff;
    border-color: #c5b3f7;
    color: #6336d6;
}

.wxgiveaway-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Page number buttons */
.wxga-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wxga-page-number:hover {
    background: #f7f4ff;
    border-color: #c5b3f7;
    color: #6336d6;
}

.wxga-page-number.active {
    background: #7a4af0;
    border-color: #7a4af0;
    color: #fff;
    cursor: default;
}

.wxga-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 34px;
    color: #aaa;
    font-size: 13px;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .wxgiveaway-ticket-search-input {
        max-width: 100%;
        width: 100%;
        min-width: unset;
    }

    .wxgiveaway-search-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .wxgiveaway-ticket-search-btn,
    .wxgiveaway-ticket-search-reset {
        width: 100%;
        justify-content: center;
    }

    .wxgiveaway-table-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .wxgiveaway-pagination-controls {
        width: 100%;
    }

    .wxgiveaway-participant-table thead th,
    .wxgiveaway-participant-table tbody td {
        padding: 10px 10px;
        font-size: 13px;
    }
}