/**
 * Yoga Collective Booking Styles
 *
 * Styles for:
 * - Enhanced calendar events with booking buttons
 * - Booking modal
 * - Loading states
 * - Success/error messages
 */

/* ==========================================================================
   Calendar Enhancements
   ========================================================================== */

/* Event spots indicator */
.event-spots {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.calendar-event.full .event-spots {
    color: var(--color-error, #dc3232);
    font-weight: 600;
}

/* Book button on event */
.event-book-btn {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background-color: var(--color-primary);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(5px);
}

.calendar-event:hover .event-book-btn {
    opacity: 1;
    transform: translateY(0);
}

.event-book-btn:hover {
    background-color: var(--color-primary-dark, #6a8ea8);
}

.calendar-event.sound .event-book-btn {
    background-color: var(--color-lavender);
}

.calendar-event.sound .event-book-btn:hover {
    background-color: var(--color-lavender-dark, #a8a0b4);
}

.calendar-event.breathing .event-book-btn {
    background-color: var(--color-accent);
}

.calendar-event.breathing .event-book-btn:hover {
    background-color: var(--color-accent-dark, #b4976d);
}

/* Full event styling */
.calendar-event.full {
    opacity: 0.7;
    cursor: not-allowed;
}

.calendar-event.full::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.03) 3px,
        rgba(0, 0, 0, 0.03) 6px
    );
    pointer-events: none;
}

/* Today highlight */
.calendar-day.today .calendar-day-header {
    background-color: var(--color-primary);
    color: white;
}

.calendar-day.today .day-name,
.calendar-day.today .day-date {
    color: white;
}

/* No events message */
.no-events {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-style: italic;
    padding: 0.5rem;
}

/* Calendar loading state */
.calendar-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

.calendar-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Schedule empty message */
.schedule-empty {
    text-align: center;
    padding: 2rem;
    background-color: var(--color-cream);
    border-radius: 8px;
    margin-top: 2rem;
}

.schedule-empty p {
    margin: 0;
    color: var(--color-text-light);
}

/* ==========================================================================
   Booking Modal
   ========================================================================== */

.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.booking-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.booking-modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-light);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.booking-modal-close:hover {
    color: var(--color-text);
}

.booking-modal-body {
    padding: 2rem;
}

.booking-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    color: var(--color-text);
}

/* Event info in modal */
.booking-event-info {
    background-color: var(--color-cream);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.booking-event-info p {
    margin: 0 0 0.5rem;
}

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

.booking-event-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text);
}

.booking-event-datetime {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.booking-event-price {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 1.1rem;
}

/* User status */
.booking-user-status {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #e8f5e9;
    border-radius: 8px;
    font-size: 0.9rem;
}

.booking-user-status p {
    margin: 0;
    color: #2e7d32;
}

.user-subscription {
    color: #1565c0 !important;
    background-color: #e3f2fd !important;
}

/* Booking actions */
.booking-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.booking-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Login required */
.booking-login-required {
    text-align: center;
}

.booking-login-required p {
    margin-bottom: 1rem;
    color: var(--color-text-light);
}

.booking-credits-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.booking-login-required .btn {
    margin: 0 0.5rem;
}

/* Loading state */
.booking-loading {
    text-align: center;
    padding: 2rem;
}

.booking-loading .spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid var(--color-cream);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.booking-loading p {
    margin: 0;
    color: var(--color-text-light);
}

/* Success state */
.booking-success {
    text-align: center;
    padding: 2rem;
}

.booking-success .success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    background-color: #4caf50;
    border-radius: 50%;
}

.booking-success h4 {
    margin: 0 0 0.5rem;
    color: #2e7d32;
}

.booking-success p {
    margin: 0;
    color: var(--color-text-light);
}

/* Error state */
.booking-error {
    text-align: center;
    padding: 2rem;
}

.booking-error .error-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    background-color: #f44336;
    border-radius: 50%;
}

.booking-error h4 {
    margin: 0 0 0.5rem;
    color: #c62828;
}

.booking-error p {
    margin: 0;
    color: var(--color-text-light);
}

/* ==========================================================================
   Body when modal is open
   ========================================================================== */

body.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Mobile Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .event-book-btn {
        opacity: 1;
        transform: none;
    }

    .booking-modal-content {
        max-width: 100%;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .booking-modal-body {
        padding: 1.5rem;
    }

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

    .booking-login-required .btn {
        display: block;
        margin: 0.5rem 0;
    }
}

/* ==========================================================================
   Color Variables (if not already defined)
   ========================================================================== */

:root {
    --color-error: #dc3232;
    --color-success: #4caf50;
    --color-primary-dark: #6a8ea8;
    --color-lavender-dark: #a8a0b4;
    --color-accent-dark: #b4976d;
}
