/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Login Page */
.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box .subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* Dashboard Header */
.header {
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
}

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

.user-info span {
    color: #666;
    font-size: 14px;
}

/* Dashboard Box */
.dashboard-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-box {
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-box p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
}

.help-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Day Schedule Cards */
#day-schedule-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-schedule-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.day-schedule-card.active {
    border-color: #667eea;
    background: white;
}

.day-schedule-header {
    padding: 15px;
    cursor: pointer;
}

.checkbox-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.checkbox-toggle input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.day-schedule-card.active .day-name {
    color: #667eea;
    font-weight: 600;
}

.day-schedule-body {
    padding: 0 15px 15px 15px;
    border-top: 1px solid #e0e0e0;
}

.day-prefs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding-top: 15px;
}

/* Court Priority Grid */
.court-priority-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #555;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.form-actions {
    margin-top: 30px;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.loading-message {
    color: #667eea;
    font-style: italic;
    padding: 15px;
    text-align: center;
}

.no-reservations {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Reservations Section */
.reservations-box {
    margin-bottom: 20px;
}

.reservations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #dc3545;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reservations-summary {
    margin-bottom: 15px;
}

.reservation-count {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.reservations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.reservations-table thead {
    background: #f8f9fa;
}

.reservations-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.reservations-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

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

.account-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.account-tanveer {
    background: #e3f2fd;
    color: #1976d2;
}

.account-tariq {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .court-priority-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .day-prefs-grid {
        grid-template-columns: 1fr;
    }

    .reservations-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .reservations-table {
        font-size: 12px;
    }

    .reservations-table th,
    .reservations-table td {
        padding: 8px;
    }

    /* Stack table on very small screens */
    .reservations-table thead {
        display: none;
    }

    .reservations-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }

    .reservations-table td {
        display: block;
        text-align: right;
        padding: 5px;
        border: none;
    }

    .reservations-table td:before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #555;
    }
}

@media (max-width: 480px) {
    .login-box,
    .dashboard-box,
    .info-box {
        padding: 20px;
    }

    .court-priority-grid {
        grid-template-columns: 1fr;
    }

    .day-prefs-grid {
        grid-template-columns: 1fr;
    }
}
