/* React Booking Component Styles */
.rehearsal-booking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
}

/* Basic layout utilities */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing utilities */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Background and colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-indigo-600 { background-color: #4f46e5; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-white { color: #ffffff; }
.text-indigo-600 { color: #4f46e5; }

/* Borders */
.border { border-width: 1px; }
.border-gray-300 { border-color: #d1d5db; }
.border-transparent { border-color: transparent; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

/* Forms */
.block { display: block; }
.w-full { width: 100%; }
select, input[type="text"], input[type="email"], input[type="tel"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #ffffff;
}

select:focus, input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.inline-flex { display: inline-flex; }
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #4f46e5;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Typography */
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }

/* Radio buttons */
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    color: #4f46e5;
    background-color: #ffffff;
    border-color: #d1d5db;
}

/* Calendar specific styles */
.react-calendar {
    width: 100%;
    max-width: 100%;
    background: white;
    border: 1px solid #a0a096;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.125em;
    border-radius: 0.5rem;
}

.react-calendar--doubleView {
    width: 700px;
}

.react-calendar--doubleView .react-calendar__viewContainer {
    display: flex;
    margin: -0.5em;
}

.react-calendar--doubleView .react-calendar__viewContainer > * {
    width: 50%;
    margin: 0.5em;
}

.react-calendar *,
.react-calendar *:before,
.react-calendar *:after {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.react-calendar button {
    margin: 0;
    border: 0;
    outline: none;
}

.react-calendar button:enabled:hover,
.react-calendar button:enabled:focus {
    background-color: #e6f3ff;
}

.react-calendar__navigation {
    display: flex;
    height: 54px !important;
    margin-bottom: 1em;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 8px !important;
    background-color: #f8fafc !important;
    border-radius: 8px 8px 0 0 !important;
}

.react-calendar__navigation button {
    min-width: 44px;
    background: none;
    font-size: 16px;
    margin-top: 0;
}

.react-calendar__navigation button:disabled {
    background-color: #f0f0f0;
}

.react-calendar__navigation button:enabled:hover,
.react-calendar__navigation button:enabled:focus {
    background-color: #e6f3ff;
}

.react-calendar__month-view__weekdays {
    text-align: center;
    text-transform: uppercase;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #6b7280 !important;
    background-color: #f9fafb !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 12px 0 !important;
}

.react-calendar__month-view__weekdays__weekday {
    padding: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.react-calendar__month-view__weekNumbers .react-calendar__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: bold;
}

.react-calendar__month-view__days__day--weekend {
    color: #dc2626 !important;
    font-weight: 500 !important;
}

.react-calendar__month-view__days__day--neighboringMonth {
    color: #757575;
}

.react-calendar__year-view .react-calendar__tile,
.react-calendar__decade-view .react-calendar__tile,
.react-calendar__century-view .react-calendar__tile {
    padding: 2em 0.5em;
}

.react-calendar__tile {
    max-width: 100%;
    padding: 10px 6.6667px;
    background: none;
    text-align: center;
    line-height: 16px;
    font: inherit;
    font-size: 0.833em;
}

.react-calendar__tile:disabled {
    background-color: #f0f0f0;
    color: #ababab;
}

.react-calendar__tile:enabled:hover,
.react-calendar__tile:enabled:focus {
    background-color: #e6f3ff;
}

.react-calendar__tile--now {
    background: #fef3c7 !important;
    color: #92400e !important;
    font-weight: 600 !important;
    border: 2px solid #f59e0b !important;
}

.react-calendar__tile--now:enabled:hover,
.react-calendar__tile--now:enabled:focus {
    background: #fde68a !important;
    color: #78350f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3) !important;
}

.react-calendar__tile--hasActive {
    background: #76baff;
}

.react-calendar__tile--hasActive:enabled:hover,
.react-calendar__tile--hasActive:enabled:focus {
    background: #a9d4ff;
}

.react-calendar__tile--active {
    background: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
}

.react-calendar__tile--active:enabled:hover,
.react-calendar__tile--active:enabled:focus {
    background: #2563eb !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4) !important;
}

/* Main container styling */
.rehearsal-booking-container {
    border: none;
}

/* Prevent horizontal overflow on all screen sizes */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.rehearsal-booking-container * {
    max-width: 100%;
}

/* Mobile-first responsive design */
@media (max-width: 767px) {
    /* Mobile optimizations */
    .rehearsal-booking-container {
        padding: 15px;
        margin: 0 auto;
        max-width: calc(100vw - 30px);
        text-align: center;
        background: white;
        border: none;
        box-sizing: border-box;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Keep form elements naturally aligned but center the container */
    .rehearsal-booking-container .grid,
    .rehearsal-booking-container form {
        text-align: left;
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
    }
    
    /* Center all main content sections */
    .rehearsal-booking-container > div {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Stack elements vertically on mobile */
    .md\\:flex-row {
        flex-direction: column !important;
    }
    
    /* Full width buttons on mobile */
    button {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        touch-action: manipulation; /* Improve touch responsiveness */
    }
    
    /* Better form spacing on mobile */
    select, input[type="text"], input[type="email"], input[type="tel"] {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        margin-bottom: 10px;
    }
    
    /* Mobile-friendly calendar - center it properly */
    .react-calendar {
        font-size: 16px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.5rem !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        margin: 1rem auto !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        overflow: hidden;
        display: block !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        background: #ffffff !important;
    }
    
    /* Calendar wrapper centering */
    .rehearsal-booking-container .react-calendar {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Center the calendar section specifically */
    .rehearsal-booking-container div:has(.react-calendar) {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }
    
    /* Remove overly broad centering - let forms stay left-aligned */
    
    .react-calendar__tile {
        padding: 18px 12px !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #1f2937 !important;
        border-radius: 4px !important;
        margin: 1px !important;
        transition: all 0.2s ease !important;
    }
    
    .react-calendar__tile:hover {
        background-color: #f3f4f6 !important;
        color: #111827 !important;
    }
    
    /* Hide double arrow buttons (previous2/next2) - they take up space */
    .react-calendar__navigation__prev2-button,
    .react-calendar__navigation__next2-button {
        display: none !important;
    }
    
    .react-calendar__navigation button {
        min-width: 54px !important;
        height: 54px !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        color: #374151 !important;
        border-radius: 8px !important;
    }
    
    .react-calendar__navigation__label {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
        flex-grow: 1 !important;
        text-align: center !important;
        margin: 0 16px !important;
        min-width: 0 !important;
    }
    
    /* Ensure navigation has proper layout on mobile */
    .react-calendar__navigation {
        height: 56px !important;
        padding: 0 12px !important;
        gap: 8px !important;
    }
    
    /* Touch-friendly time slots */
    .time-slot-button {
        min-height: 44px;
        padding: 12px;
        margin: 4px 0;
        touch-action: manipulation;
    }
    
    /* Better grid spacing on mobile */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Hide unnecessary elements on small screens */
    .text-sm {
        font-size: 14px;
    }
    
    /* Center the main "Book Now" card */
    .rehearsal-booking-container .bg-white.shadow-lg {
        margin: 0 auto !important;
        max-width: 400px;
        width: 100%;
        text-align: center;
    }
    
    /* Center all card content but keep form fields left-aligned */
    .rehearsal-booking-container .bg-white.shadow-lg h2 {
        text-align: center;
    }
    
    .rehearsal-booking-container .bg-white.shadow-lg > div {
        margin: 0 auto;
        width: 100%;
    }
    
    /* Mobile-friendly language switcher - center header area */
    .rehearsal-booking-container .flex.justify-between {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .rehearsal-booking-container .flex.justify-between h1 {
        font-size: 1.5rem !important;
        text-align: center;
        margin: 0;
    }
    
    .rehearsal-booking-container .flex.items-center.space-x-2 {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Calendar section centering */
    .rehearsal-booking-container h3 {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    /* Customer Information section */
    .rehearsal-booking-container h4 {
        text-align: center;
        margin-bottom: 1rem;
    }
}

@media (min-width: 640px) {
    .sm\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\\:flex-row { flex-direction: row; }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, input, select {
        min-height: 44px;
    }
    
    /* Better hover states for touch */
    .react-calendar__tile:hover {
        background-color: #e6f3ff !important;
    }
    
    /* Remove hover effects that don't work on touch */
    button:hover {
        background-color: inherit;
    }
    
    button.btn-primary:hover {
        background-color: #4338ca;
    }
}

/* Error states */
.text-red-500 { color: #ef4444; }
.bg-red-50 { background-color: #fef2f2; }
.border-red-300 { border-color: #fca5a5; }

/* Loading states */
.opacity-75 { opacity: 0.75; }
.cursor-wait { cursor: wait; }
.cursor-not-allowed { cursor: not-allowed; }

/* Animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Transition */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; }
.duration-150 { transition-duration: 150ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }