/* Booking-specific styles */

#booking-plan {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.booking-rules {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.booking-rules h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #212529;
}

.booking-rules p {
    margin: 0 0 6px 0;
    font-size: 0.92rem;
    color: #343a40;
    line-height: 1.35;
}

.booking-rules p:last-child {
    margin-bottom: 0;
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.booking-header h2 {
    color: #375DA4;
}

.booking-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-date {
    font-weight: bold;
    margin: 0 1rem;
    min-width: 200px;
    text-align: center;
}

/* Booking Grid Styles */
.booking-grid {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.booking-grid th,
.booking-grid td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.booking-grid th {
    background-color: #f8f9fa;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-cell {
    background-color: #e9ecef;
    font-weight: bold;
    width: 80px;
    writing-mode: horizontal-tb;
    text-orientation: initial;
}

.booking-slot {
    height: 40px;
    min-width: 0;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.booking-slot.available {
    background-color: #d4edda;
}

.booking-slot.available:hover {
    background-color: #c3e6cb;
}

.booking-slot.future-unavailable {
    background-color: #e8f5e9;
    cursor: default;
}

.booking-slot.future-unavailable:hover {
    background-color: #e8f5e9;
}

.booking-slot.unavailable {
    background-color: #ffffff;
    cursor: default;
}

.booking-slot.unavailable:hover {
    background-color: #f8f9fa;
}

.booking-slot.booked {
    background-color: #ffffff;
    cursor: default;
}

.booking-slot.booked:hover {
    background-color: #f8f9fa;
}

/* Booking Info Display */
.booking-info {
    position: relative;
    font-size: 0.8rem;
    line-height: 1.2;
}

.booking-type {
    font-weight: bold;
    color: #495057;
    margin-bottom: 2px;
}

.delete-booking {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.delete-booking:hover {
    background-color: #c82333;
}

.player {
    color: #212529;
    font-size: 0.75rem;
    font-weight: 600;
}

.delete-booking {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: none;
}

.booking-slot.booked:hover .delete-booking {
    display: block;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}


/* Message Styles */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.modal-message {
    display: none;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.modal-message.success-message {
    display: block;
}

.modal-message.error-message {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .booking-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .booking-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .date-navigation {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .booking-grid {
        font-size: 0.8rem;
    }
    
    .booking-slot {
        min-width: 0;
        height: 35px;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .booking-grid th,
    .booking-grid td {
        padding: 4px;
        font-size: 0.7rem;
    }
    
    .booking-slot {
        min-width: 0;
        height: 30px;
    }
    
    .booking-info {
        font-size: 0.6rem;
    }
    
    .player {
        font-size: 0.5rem;
    }
}

/* Loading States */
.btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading::after {
    content: "...";
    animation: loading 1s infinite;
}

@keyframes loading {
    0%, 33% { content: "."; }
    34%, 66% { content: ".."; }
    67%, 100% { content: "..."; }
}

/* Navigation Styles */
nav a.active {
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    padding: 0.5rem 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#username-display {
    color: #ced0d3;
    font-weight: bold;
}
