* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #495057;
}

.club-selection {
    margin-bottom: 30px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e9ecef;
    font-size: 1em;
}

.checkbox-group label:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

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

.date-selection {
    margin-bottom: 30px;
}

.date-selection input[type="date"] {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    font-size: 1em;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.date-selection input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.duration-selection {
    margin-bottom: 30px;
}

.duration-select {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    font-size: 1em;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

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

.time-range-selection {
    margin-bottom: 30px;
}

.time-range-selection .optional-label {
    font-weight: normal;
    color: #6c757d;
    font-size: 0.9em;
}

.time-range-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.time-range-inputs label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-range-inputs .time-input {
    width: 6ch;
    min-width: 4rem;
    padding: 10px 12px;
    font-size: 1em;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    -moz-appearance: textfield;
    appearance: textfield;
}

.time-range-inputs .time-input::-webkit-outer-spin-button,
.time-range-inputs .time-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-range-inputs .time-input:focus {
    outline: none;
    border-color: #667eea;
}

.time-range-inputs .clear-btn {
    padding: 8px 12px;
    font-size: 1.2em;
    line-height: 1;
    color: #6c757d;
    background: #e9ecef;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.time-range-inputs .clear-btn:hover {
    color: #495057;
    background: #dee2e6;
    border-color: #dee2e6;
}

.search-btn {
    width: 100%;
    max-width: 300px;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.loading {
    padding: 60px;
    text-align: center;
}

.loading.hidden {
    display: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.results {
    padding: 40px;
    color: #333;
}

.club-results {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e9ecef;
}

.club-results h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.no-availability {
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.slot-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.slot-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.slot-time {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.slot-court {
    color: #495057;
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 5px;
    padding: 3px 8px;
    background: #e9ecef;
    border-radius: 4px;
    display: inline-block;
}

.slot-duration {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.slot-price {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1em;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e9ecef;
    }

    .container {
        background: #1e1e1e;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }

    .controls {
        background: #2d2d2d;
        border-bottom: 1px solid #404040;
    }

    .controls h2 {
        color: #e9ecef;
    }

    .checkbox-group label {
        background: #2d2d2d;
        border-color: #404040;
        color: #e9ecef;
    }

    .checkbox-group label:hover {
        border-color: #667eea;
        background: #353535;
    }

    .date-selection input[type="date"],
    .duration-select {
        background: #2d2d2d;
        border-color: #404040;
        color: #e9ecef;
    }

    .date-selection input[type="date"]:focus,
    .duration-select:focus {
        border-color: #667eea;
        background: #353535;
    }

    .club-results {
        background: #2d2d2d;
        border-color: #404040;
    }

    .club-results h2 {
        color: #e9ecef;
    }

    .no-availability {
        color: #adb5bd;
    }

    .slot-card {
        background: #2d2d2d;
        border-color: #404040;
        color: #e9ecef;
    }

    .slot-card:hover {
        border-color: #667eea;
        background: #353535;
    }

    .slot-court {
        color: #e9ecef;
        background: #404040;
    }

    .slot-duration {
        color: #adb5bd;
    }

    .error {
        background: #3d1f1f;
        color: #ff6b6b;
        border-color: #5a2a2a;
    }

    .results {
        color: #e9ecef;
    }

    .results h2 {
        color: #e9ecef;
    }

    .spinner {
        border-color: #2d2d2d;
        border-top-color: #667eea;
    }

    .time-range-selection .optional-label {
        color: #adb5bd;
    }

    .time-range-inputs .time-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #e9ecef;
    }

    .time-range-inputs .time-input:focus {
        border-color: #667eea;
        background: #353535;
    }

    .time-range-inputs .clear-btn {
        color: #adb5bd;
        background: #404040;
        border-color: #404040;
    }

    .time-range-inputs .clear-btn:hover {
        color: #e9ecef;
        background: #4a4a4a;
        border-color: #4a4a4a;
    }

    .time-range-inputs label {
        color: #e9ecef;
    }

    .loading {
        color: #e9ecef;
    }
}

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

    .controls {
        padding: 20px;
    }

    .checkbox-group {
        flex-direction: column;
    }

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