/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.data-banner {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9em;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.data-banner strong {
    font-weight: 600;
}

/* ===== STATS CARDS ===== */
.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card .number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #666;
    font-size: 0.9em;
}

/* ===== FILTERS ===== */
.filters {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filters h3 {
    color: #333;
    font-size: 1em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.filter-toggle {
    font-size: 0.8em;
    color: #667eea;
    transition: transform 0.3s;
}

.filter-toggle.collapsed {
    transform: rotate(-90deg);
}

.filter-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 16px;
}

.filter-content.collapsed {
    max-height: 0;
    margin-top: 0;
}

.filter-section {
    margin-bottom: 12px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section label {
    display: block;
    color: #666;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 6px;
}

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

/* Filter inputs */
.filters input[type="text"],
.filters input[type="date"],
.filters input[type="number"],
.filters select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s;
}

.filters input[type="text"]:focus,
.filters input[type="date"]:focus,
.filters input[type="number"]:focus,
.filters select:focus {
    outline: none;
    border-color: #667eea;
}

/* Filter checkboxes */
.checkbox-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

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

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    color: #333;
    font-weight: 500;
    font-size: 0.9em;
}

/* Price range */
.price-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price-range input {
    flex: 1;
}

.price-range span {
    color: #666;
    font-size: 0.9em;
}

/* Filter actions */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.btn-reset {
    padding: 6px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    color: #666;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset:hover {
    background: #e0e0e0;
}

.filter-count {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: #667eea;
    font-size: 0.85em;
    font-weight: 600;
}

/* ===== TABLE ===== */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: visible;
    margin-bottom: 40px;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

/* Table header */
.events-table thead {
    background: #5a4a9f;
    color: white;
}

.events-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #5a4a9f;
    z-index: 10;
}

.events-table th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.events-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.5;
    font-size: 0.8em;
}

.events-table th.sorted .sort-icon {
    opacity: 1;
}

/* Table body */
.events-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.events-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

.events-table td {
    padding: 14px 12px;
    font-size: 0.9em;
}

/* Table cells */
.event-name-cell {
    font-weight: 600;
    color: #333;
    max-width: 250px;
}

.event-date-cell {
    color: #666;
    white-space: nowrap;
}

.event-location-cell {
    color: #666;
    max-width: 200px;
}

.tickets-remaining-cell {
    text-align: center;
    font-weight: 600;
    color: #9b6ec4;
}

.seats-remaining-cell {
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.seats-remaining-cell .percentage {
    font-size: 0.85em;
    color: #999;
    font-weight: 500;
    margin-left: 4px;
}

.tickets-sold-cell {
    text-align: center;
    font-weight: 600;
    color: #764ba2;
}

/* ===== STATUS INDICATORS ===== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-available {
    background-color: #28a745;
    box-shadow: 0 0 4px rgba(40, 167, 69, 0.4);
}

.status-limited {
    background-color: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.4);
}

.status-soldout {
    background-color: #dc3545;
    box-shadow: 0 0 4px rgba(220, 53, 69, 0.4);
}

/* ===== UTILITY STATES ===== */
.loading {
    text-align: center;
    color: white;
    font-size: 1.5em;
    padding: 60px;
}

.no-events {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.no-events h2 {
    color: #666;
    margin-bottom: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .stats {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }

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

    .events-table {
        min-width: 800px;
    }
}