/**
 * Public Booking Page Styles
 * Calendly-style booking experience
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 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-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* App Container */
.booking-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Loading State */
.booking-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* Error State */
.booking-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
}

.booking-error .error-icon {
    color: var(--error-color);
    margin-bottom: 16px;
}

.booking-error h2 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Main Container */
.booking-container {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px;
    width: 100%;
}

/* Business Header */
.booking-header {
    text-align: center;
    margin-bottom: 32px;
}

.business-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    overflow: hidden;
}

.business-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.business-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.business-description {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Step Indicator */
.booking-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.step.active {
    color: var(--primary-color);
}

.step.completed {
    color: var(--success-color);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    display: none;
}

@media (min-width: 480px) {
    .step-label {
        display: inline;
    }
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

/* Booking Steps */
.booking-step {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.booking-step h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.booking-step h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Back Button */
.back-button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
}

.back-button:hover {
    color: var(--primary-hover);
}

/* Service List */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
}

.service-card.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.service-color {
    width: 4px;
    height: 48px;
    border-radius: 2px;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.service-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.service-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Selected Service Display */
.selected-service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.selected-service .service-color {
    height: 32px;
}

.selected-service .service-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0;
}

.selected-service .service-meta {
    font-size: 12px;
}

/* Calendar */
.calendar-container {
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month {
    font-weight: 600;
    font-size: 16px;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

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

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.2s;
}

.calendar-day:hover:not(.disabled):not(.empty) {
    background: var(--bg-light);
}

.calendar-day.today {
    font-weight: 600;
    color: var(--primary-color);
}

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

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

.calendar-day.empty {
    cursor: default;
}

.calendar-day.has-slots {
    position: relative;
}

.calendar-day.has-slots::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--success-color);
}

.calendar-day.selected::after {
    background: white;
}

/* Time Slots */
.time-slots-container {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (min-width: 480px) {
    .time-slots {
        grid-template-columns: repeat(4, 1fr);
    }
}

.time-slot {
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.no-slots {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
}

/* Booking Summary */
.booking-summary {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 500;
    text-align: right;
}

/* Form */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    background: #fef2f2;
    color: var(--error-color);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* Buttons */
.submit-button,
.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.submit-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.secondary-button {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.secondary-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Success State */
.success-container {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    color: var(--success-color);
    margin-bottom: 20px;
}

.success-container h2 {
    margin-bottom: 8px;
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirmation-details {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.confirmation-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.confirmation-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.confirmation-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.confirmation-text {
    font-size: 14px;
}

.confirmation-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.booking-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.booking-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.booking-footer a:hover {
    text-decoration: underline;
}

/* Dynamic Theme Color */
.booking-app[data-color] {
    --primary-color: attr(data-color);
}
