/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1);
}

/* Centering the Facility Section */
.facility-container {
    width: 60%;
    margin: 0 auto; /* Horizontally center the container */
    border: 4px solid #000; /* Border around the entire facility */
    padding: 10px;
    text-align: center;
}

/* Centering Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

/* Section Styles */
section {
    margin-bottom: 40px;
}

/* Centering Rules Section */
.rules {
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    /* padding: 15px; */
}

.rule-text {
    text-align: justify;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    margin-left: 80px;
    margin-right: 80px;
    color: #333;
}

.rules ul {
    list-style-type: none;
    padding: 0;
    margin-top: 20px;
}

.rules li {
    margin-bottom: 10px;
    font-size: 16px;
}

@media (max-width: 480px) {
    .rules {
        padding-left: 30px; /* Left margin */
        padding-right: 30px; /* Right margin */
    }

    .rule-text {
        font-size: 15px; /* Smaller font size for mobile */
        line-height: 1.4; /* Slightly reduced line height for better spacing */
        margin-bottom: 10px;
        margin-left: 10px; /* Left margin for better spacing */
        margin-right: 10px; /* Right margin for better spacing */
    }
}

/* Facility Layout Section */
.layout {
    text-align: center; /* Center the title horizontally */
    margin: 0 auto; /* Horizontally center the section */
    max-width: 800px; /* Optional: Limit the width of the section */
}

.court-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 20px; /* Space between the courts */
    justify-items: center; /* Centers courts horizontally within each column */
    align-items: center; /* Vertically aligns the courts */
    margin-top: 20px; /* Adds spacing above the layout */
}

.court-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0; /* Reduced margin to bring courts vertically closer */
}

/* Styling for Individual Courts */
.court {
    width: 158px;
    height: 100px; /* Adjusted height for a more realistic look */
    border: 2px solid #000; /* Border around each court */
    background-color: #4CAF50; /* Green to represent a badminton court */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    box-sizing: border-box;
    transition: background-color 0.3s ease; /* Smooth transition for hover effect */
}

.court:hover {
    background-color: #45a049; /* Slightly darker green on hover */
}

/* Form Section */
.booking-form {
    text-align: center; /* Center the title horizontally */
    margin: 0 auto; /* Horizontally center the section */
    max-width: 800px; /* Optional: Limits the width of the section */
    padding: 20px; /* Adds some padding inside the section */
}

/* Styling for Form Group */
.form-group {
    margin-bottom: 20px;
    text-align: center; /* Align labels and inputs to the center */
}

.checkbox-label {
    display: inline-flex; /* Align text and checkbox horizontally */
    align-items: center; /* Vertically align the checkbox with the label text */
    gap: 5px; /* Optional: adds space between text and checkbox */
}

/* Styling for Form Elements */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="date"] {
    text-align: center;
    padding: 8px;
    width: 20%;
    max-width: 300px;
    border-radius: 5px;
}

/* Table Styles for Booking Slots */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    /* text-align: left; */
}

th, td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

td button {
    padding: 4px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

td button:hover {
    background-color: #45a049;
}

#avail-courts {
    font-size: 24px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    #avail-courts {
        font-size: 20px; /* Reduce font size on smaller screens */
    }

    table {
        font-size: 14px; /* Reduce font size of table text */
    }

    th, td {
        padding: 8px; /* Smaller padding for tables on mobile */
    }

    table {
        overflow-x: scroll; /* Allow horizontal scrolling on smaller screens */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    td {
        word-wrap: break-word; /* Prevents text from overflowing the cells */
    }
}

@media (max-width: 480px) {
    #avail-courts {
        font-size: 18px; /* Further reduce font size */
    }

    th, td {
        font-size: 7px;
        padding: 2px; /* Further reduce padding for mobile */
    }

    /* Increase input size for better tap area */
    #datepicker {
        font-size: 18px;
        padding: 12px;
        width: 60%;
    }

    /* Increase Flatpickr calendar icon size */
    .flatpickr-input::after {
        font-size: 24px;
        right: 10px; /* Adjust position */
    }

    /* Make the Flatpickr calendar pop-up larger */
    .flatpickr-calendar {
        font-size: 18px !important;
    }
}

/* Booking Button Styles */
.select-btn, .remove-btn, .apply-discount-btn, .checkout-btn {
    width: 100%;
}

#booking-date {
    font-family: 'Arial', sans-serif; /* Change to your preferred font */
    font-size: 16px; /* Adjust the font size if needed */
    color: #333; /* Optional: Change text color */
}

.remove-btn {
    background-color: #f44336;
}

.remove-btn:hover {
    background-color: #e53935;
}

.apply-discount-btn {
    background-color: #2196F3;
    width: auto;
    margin-top: 10px;
}

.apply-discount-btn:hover {
    background-color: #1976D2;
}

/* Discount Section Styling */
.discount-section {
    text-align: center; /* Center the discount section title */
    margin-top: 30px; /* Adds space between the booking form and the discount section */
}

.discount-section h3 {
    font-size: 20px;
    margin-bottom: 20px; /* Adds space between the heading and the input field */
}

.discount-input-group {
    display: flex; /* Use flexbox to arrange the input and button in a row */
    justify-content: center; /* Center the items within the group */
    gap: 10px; /* Adds space between the input field and button */
}

.discount-input {
    padding: 8px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 300px; /* Set a width for the input field */
}

.apply-discount-btn {
    padding: 4px 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.apply-discount-btn:hover {
    background-color: #1976D2; /* Slightly darker shade on hover */
}

.discount-message {
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50; /* Green for success messages */
}

.discount-message.error {
    color: #f44336; /* Red for error messages */
}

/* BNM Tokens Section */
h2 {
    margin-bottom: 20px;
}

.btn {
    padding: 4px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn:hover {
    background-color: #45a049; /* Slightly darker green on hover */
}

.btn:disabled {
    background-color: #d3d3d3;
}

input[type="number"] {
    padding: 10px;
    font-size: 16px;
    text-align: center;  /* Horizontally center the text */
    line-height: 30px;  /* Vertically center the text */
    width: 40px;
    margin-bottom: 20px;
    border-radius: 5px;  /* Optional: Adding rounded corners */
    background-color: #fff;  /* Optional: White background for input */
}

/* Checkout Section Styling */
.checkout-section {
    text-align: center; /* Center the checkout section title */
    margin-top: 30px; /* Add space between the discount section and checkout */
    padding: 20px; /* Padding inside the section */
    background-color: #f9f9f9; /* Light background for the checkout section */
    border-radius: 10px; /* Rounded corners for the checkout section */
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1); /* Light shadow for emphasis */
}

.checkout-section h2 {
    font-size: 24px; /* Larger font size for the heading */
    margin-bottom: 20px; /* Space between the title and the content */
}

.confirmation-label {
    display: flex; /* Use flexbox to align items in a row */
    align-items: center; /* Vertically align checkbox and text */
    gap: 5px; /* Add some space between the text and the checkbox */
    margin-bottom: 10px; /* Optional margin for spacing */
}

/* Optional: Adjust styling for checkbox */
.confirmation-label input[type="checkbox"] {
    margin-left: 5px; /* Optional margin for spacing the checkbox */
}

.checkout-details {
    text-align: left; /* Align the details to the left */
    max-width: 600px; /* Limit the width of the details section */
    margin: 0 auto; /* Center the details section horizontally */
}

.checkout-details p {
    font-size: 16px; /* Text size for the details */
    margin-bottom: 10px; /* Spacing between each detail item */
}

.checkout-details .total {
    font-size: 18px; /* Larger font size for the total */
    font-weight: bold;
    color: #4CAF50; /* Green color for the total price */
    margin-top: 20px; /* Adds space before the total price */
}

.checkout-btn {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 30px; /* Adds space above the button */
}

.checkout-btn:hover {
    background-color: #45a049; /* Slightly darker green on hover */
}

.checkout-btn:disabled {
    background-color: #dcdcdc; /* Disabled button color */
    cursor: not-allowed; /* Indicates that the button is disabled */
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .court-layout {
        grid-template-columns: 1fr 1fr; /* Two columns for smaller screens */
    }

    .discount-input {
        width: 100%; /* Allow input field to grow on smaller screens */
        max-width: 300px;
    }

    .checkout-details p {
        font-size: 14px; /* Adjust font size for mobile view */
    }
}

/* Loading Spinner */
#loading {
    display: none;
}

/* Loading spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
  
  /* Spinner animation */
  @keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}