/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 2.5em;
    font-weight: 300;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2.5em;
    margin-bottom: 5px;
    font-weight: 300;
}

.stat-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Filters */
.filters {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.search-bar {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

#search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

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

#clear-search {
    background: none;
    border: none;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: color 0.3s ease;
}

#clear-search:hover {
    color: #667eea;
}

.qr-scan-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qr-scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.qr-scan-btn:active {
    transform: translateY(0);
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.event-filter {
    min-width: 200px;
}

#event-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#event-select:focus {
    outline: none;
    border-color: #667eea;
}

.export-section {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-btn {
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.toggle-columns-btn {
    padding: 12px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-columns-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.column-selection {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    border: 2px solid #e1e8ed;
    animation: slideDown 0.3s ease-out;
}

.column-selection h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.column-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.column-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: color 0.3s ease;
}

.column-checkboxes label:hover {
    color: #333;
}

.column-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

th {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Status badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    min-width: 100px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-checked {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

/* Action buttons */
.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.checkin-btn {
    background: #28a745;
    color: white;
}

.checkin-btn:hover {
    background: #218838;
}

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

.checkout-btn:hover {
    background: #c82333;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2em;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

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

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        min-width: auto;
    }

    .filter-buttons {
        justify-content: center;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }

    th, td {
        padding: 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    th, td {
        padding: 8px;
        font-size: 0.8em;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

/* QR Scanner Section */
.qr-scanner-section {
    background: white;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

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

.qr-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.qr-scanner-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.qr-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.qr-reader {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
}

.qr-instructions {
    padding: 15px 20px 20px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.qr-instructions p {
    margin: 5px 0;
    font-size: 0.9em;
}
