:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #f4f4f5;
    --border-color: #e4e4e7;
    --text-color: #18181b;
    --text-light: #52525b;
    --white: #ffffff;
    --free-bg: #dcfce7;
    --pending-bg: #fef9c3;
    --booked-bg: #fee2e2;
    --free-text: #166534;
    --pending-text: #a16207;
    --booked-text: #991b1b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

main > section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

nav {
    display: flex;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    cursor: pointer;
    background: transparent;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: var(--text-light);
}

.tab-btn:hover {
    background: var(--secondary-color);
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Calendar */
.calendar-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th, td {
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

th {
    background: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    font-weight: 500;
}

td.free { background-color: var(--free-bg); color: var(--free-text); }
td.pending { background-color: var(--pending-bg); color: var(--pending-text); }
td.booked { background-color: var(--booked-bg); color: var(--booked-text); }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}
.legend-item {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}
.legend-item.free { background-color: var(--free-bg); color: var(--free-text); }
.legend-item.pending { background-color: var(--pending-bg); color: var(--pending-text); }
.legend-item.booked { background-color: var(--booked-bg); color: var(--booked-text); }


/* Booking Form */
.selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.selector label {
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#bookingForm {
    margin-top: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

#otherServiceDiv {
    display: none; /* Hidden by default */
}

label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
    background-color: var(--white);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M10 13a1 1 0 01-.707-.293l-3-3a1 1 0 111.414-1.414L10 10.586l2.293-2.293a1 1 0 111.414 1.414l-3 3A1 1 0 0110 13z' clip-rule='evenodd' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem !important;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

button, .submit-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

button:hover, .submit-btn:hover {
    background: var(--primary-hover);
}

.submit-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

#availabilityResult, #bookingResponse {
    font-weight: bold;
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
}
#availabilityResult[style*="color: green"], #bookingResponse[style*="color: green"] {
    background-color: var(--free-bg);
    color: var(--free-text);
}
#availabilityResult[style*="color: red"], #bookingResponse[style*="color: red"] {
    background-color: var(--booked-bg);
    color: var(--booked-text);
}
#availabilityResult[style*="color: orange"], #bookingResponse[style*="color: orange"] {
    background-color: var(--pending-bg);
    color: var(--pending-text);
}

/* Contact Tab */
.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    main > section {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: auto;
    }
}