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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

/* ===== Demo Container ===== */
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.demo-header {
    text-align: center;
    margin-bottom: 3rem;
}

.demo-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.demo-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.demo-main {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    min-height: 500px;
}

.demo-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Booking Calendar ===== */
.booking-calendar {
    max-width: 900px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.calendar-nav button {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-primary);
}

.calendar-nav button:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.calendar-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-month-year {
    font-weight: 600;
    font-size: 1.125rem;
    min-width: 200px;
    text-align: center;
}

/* ===== Calendar Grid ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.75rem;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    border: 2px solid transparent;
    background: var(--background);
}

.calendar-day:hover:not(.disabled):not(.blocked) {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.calendar-day.today {
    border-color: var(--primary-color);
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
}

.calendar-day.disabled {
    color: var(--text-secondary);
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.blocked {
    background: repeating-linear-gradient(
        45deg,
        #f3f4f6,
        #f3f4f6 10px,
        #e5e7eb 10px,
        #e5e7eb 20px
    );
    color: var(--text-secondary);
    cursor: not-allowed;
}

.calendar-day.other-month {
    opacity: 0.4;
}

/* ===== Time Slots ===== */
.time-slots-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.time-slots-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.time-slot {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.time-slot-time {
    font-size: 1rem;
    font-weight: 600;
}

.time-slot-capacity {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success-color);
}

.time-slot-capacity.low {
    color: #ff9800;
}

.time-slot-capacity.full {
    color: var(--danger-color);
}

.time-slot:hover:not(.booked):not(.disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.time-slot.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.time-slot.booked {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Booking Form ===== */
.booking-form {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.booking-form h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.booking-details {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.booking-details p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

/* ===== Confirmation Message ===== */
.confirmation-message {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.3s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease;
}

.confirmation-message h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.confirmation-message p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .demo-container {
        padding: 1rem;
    }

    .demo-header h1 {
        font-size: 2rem;
    }

    .demo-main {
        padding: 1.5rem;
    }

    .calendar-grid {
        gap: 0.25rem;
    }

    .calendar-day {
        font-size: 0.875rem;
    }

    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-nav {
        flex-wrap: wrap;
    }

    .calendar-month-year {
        width: 100%;
        order: -1;
        margin-bottom: 1rem;
    }

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

/* Form Hints */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Booking Details Styling */
.booking-details p {
    margin-bottom: 0.5rem;
}

.booking-details #availableCapacity {
    font-weight: 600;
}
