/* style.css */

/* General Body and Font Styles */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    line-height: 1.6;
    color: #333;
}

/* Headings */
h1, h2, h3 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

/* Container Styles for Calendar */
.calendar {
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    text-align: center;
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally within the column */
    gap: 10px; /* Space between label and input */
}

.calendar label {
    font-weight: bold;
    margin-bottom: 5px; /* Add some space below the label */
}

/* Datepicker Input Field */
#datepicker {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 180px; /* Slightly wider for better appearance */
    max-width: 100%; /* Ensure it doesn't overflow on small screens */
    text-align: center;
    cursor: pointer; /* Indicate it's clickable */
}

/* Container for appointment slots section on the main page */
#appointmentSlotsSection { /* Use the ID here */
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    text-align: center;
}

#appointmentSlotsSection h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* New container for time slots grid */
.time-slots-grid {
    display: grid; /* Use CSS Grid for layout */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Responsive grid columns */
    gap: 10px; /* Space between grid items (buttons) */
    padding: 10px 0; /* Add some padding around the grid */
    justify-content: center; /* Center grid items if they don't fill the row */
    align-items: stretch; /* Make items stretch to fill available height */
}

/* Message when no slots are available */
.appointment-slots p {
    width: 100%; /* Make paragraph take full width */
    text-align: center;
    color: #666;
}

/* Booking Buttons for Time Slots - Styled to look like calendar cells */
.book-button {
    flex-shrink: 0; /* Prevent buttons from shrinking */
    background-color: #e0e0e0; /* Lighter grey for available cells */
    color: #333; /* Darker text */
    padding: 15px 10px; /* More padding for a larger cell look */
    border: 1px solid #ccc; /* Border to define cells */
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px; /* Slightly smaller font if needed for space */
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
    text-align: center;
    height: 60px; /* Fixed height for consistent cell size */
    display: flex; /* Use flexbox for centering text inside */
    align-items: center;
    justify-content: center;
    box-sizing: border-box; /* Include padding and border in height/width */
}

.book-button:hover {
    background-color: #007bff; /* Blue on hover, like a selected date */
    color: white;
    border-color: #007bff;
}

/* --- Pop-up Styles --- */

/* Main Pop-up Container */

.popup {
    display: none; /* Initially hidden */
    position: fixed; /* Stays in place when scrolling */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background overlay */
    z-index: 9999; /* Make sure it's on top */
    display: flex; /* Use flexbox to center content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.popup-content {
    background-color: #fefefe;
    margin: auto; /* For older browsers, flexbox handles centering better */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Or a specific max-width */
    max-width: 500px; /* Example max width */
    position: relative; /* Needed for positioning the close button */
    z-index: 10000; /* Ensure content is above the overlay */
}

/* Close Button (X icon) */
.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

/* Booking Form Elements */
#bookingForm label {
    display: block;
    margin-bottom: 8px;
    margin-top: 15px;
    font-weight: bold;
}

#bookingForm input[type="text"],
#bookingForm input[type="email"],
#bookingForm input[type="number"] {
    width: calc(100% - 22px); /* Full width minus padding and border */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#bookingForm button[type="submit"] {
    background-color: #28a745; /* Green for submission */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

#bookingForm button[type="submit"]:hover {
    background-color: #218838;
}

/* Math Captcha Section */
#mathCaptcha {
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
    text-align: center;
}

#mathCaptcha p {
    margin: 5px 0;
    font-size: 1.1em;
    font-weight: bold;
}

#mathCaptcha input {
    text-align: center;
}

/* Confirmation and Error Messages */
#bookingConfirmation, #bookingError {
    text-align: center;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#bookingConfirmation {
    background-color: #d4edda; /* Light green */
    border: 1px solid #c3e6cb;
    color: #155724; /* Dark green text */
}

#bookingError {
    background-color: #f8d7da; /* Light red */
    border: 1px solid #f5c6cb;
    color: #721c24; /* Dark red text */
}

/* Close buttons within confirmation/error messages */
#closeConfirmation, #closeError {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #6c757d; /* Grey for close button */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#closeConfirmation:hover, #closeError:hover {
    background-color: #5a6268;
}

/* --- jQuery UI Datepicker Overrides (Styling the calendar popup) --- */

.ui-datepicker {
    width: 250px; /* Adjust width of the calendar popup */
    font-family: Arial, sans-serif;
    font-size: 0.9em;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    background-color: #fff; /* Ensure white background for calendar */
    border: 1px solid #ddd;
}

.ui-datepicker .ui-datepicker-header {
    background-color: #007bff; /* Header background */
    color: white;
    border: none;
    border-radius: 5px 5px 0 0;
    padding: 10px 0;
}

.ui-datepicker .ui-datepicker-title {
    margin: 0.7em 0;
    text-align: center;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    top: 10px;
    width: 2em;
    height: 2em;
    cursor: pointer;
    background-image: none; /* Remove default background arrow */
    text-indent: 0;
    font-weight: bold;
    color: white; /* Make arrows white */
    line-height: 2em;
    text-align: center;
    border-radius: 50%;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background-color: #0056b3;
}

.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
    display: block;
    font-size: 1.2em;
}

.ui-datepicker .ui-datepicker-prev { float: left; }
.ui-datepicker .ui-datepicker-next { float: right; }

.ui-datepicker table {
    width: 100%;
    margin: 10px 0 0;
    border-collapse: collapse;
}

.ui-datepicker th {
    padding: 0.7em 0.3em;
    text-align: center;
    font-weight: bold;
    border: 0;
    color: #666;
}

.ui-datepicker td {
    border: 0;
    padding: 1px;
}

.ui-datepicker td span, .ui-datepicker td a {
    display: block;
    padding: 0.7em;
    text-align: right;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 5px;
}

/* Default date state */
.ui-state-default {
    background: #f7f7f7;
    color: #333;
}

.ui-state-default:hover {
    background: #e0e0e0;
}

/* Highlighted (selected) date */
.ui-state-highlight, .ui-datepicker td .ui-state-highlight {
    background: #add8e6; /* Light blue */
    color: #333;
}

/* Active (today) date */
.ui-state-active, .ui-datepicker .ui-state-active {
    background: #007bff; /* Darker blue */
    color: white;
    font-weight: bold;
}

/* Unselectable/disabled dates (e.g., past dates, out of range) */
.ui-datepicker .ui-datepicker-unselectable span {
    color: #ccc;
}

/* --- Responsiveness --- */

@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    #datepicker {
        width: calc(100% - 22px); /* Adjust to fill available width better on small screens */
        box-sizing: border-box; /* Include padding and border in width */
    }
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjust columns for smaller screens */
    }
/* Styling für deaktivierte Tage im Kalender */
.duet-date-picker--day__disabled {
    cursor: not-allowed !important; /* Verbotssymbol beim Überfahren */
    color: #a0a0a0 !important; /* Graue Farbe für nicht verfügbare Tage */
    text-decoration: line-through !important; /* Durchgestrichener Text */
}

/* Optional: Hover-Effekt für deaktivierte Tage */
.duet-date-picker--day__disabled:hover {
    background-color: #f0f0f0; /* Leicht grauer Hintergrund beim Überfahren */
}

/* Styling für deaktivierte Tage im Kalender */
.duet-date-picker--day__disabled {
    cursor: not-allowed !important; 
    color: #a0a0a0 !important; 
    text-decoration: line-through !important;
}

/* Optional: Hover-Effekt für deaktivierte Tage */
.duet-date-picker--day__disabled:hover {
    background-color: #f0f0f0; 
}