/**
 * Calendar Widget Styles
 * 
 * Styles for the appointment booking calendar widget
 * 
 * @package Leadership_Coach
 * @since 1.0.0
 */

/* Calendar Container */
.calendar-display-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-background);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(var(--primary-purple-rgb), 0.1);
}

.calendar-display-section h3 {
    color: var(--primary-purple);
    font-family: var(--heading-font);
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Calendar Widget */
.calendar-widget {
    background: var(--white-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 6px rgba(var(--dark-text-rgb), 0.1);
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-pink);
}

.calendar-title {
    color: var(--primary-purple);
    font-family: var(--heading-font);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0;
}

.calendar-nav {
    background: var(--secondary-lilac);
    border: none;
    border-radius: 50%;
    color: var(--white-color);
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-weight: bold;
    height: 40px;
    transition: all 0.3s ease;
    width: 40px;
}

.calendar-nav:hover {
    background: var(--primary-purple);
    transform: scale(1.1);
}

.calendar-nav:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

.calendar-nav .screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute !important;
    width: 1px;
}

/* Calendar Grid */
.calendar-grid {
    margin-bottom: 1.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 0.5rem;
}

.weekday {
    background: var(--accent-pink);
    color: var(--dark-text);
    font-family: var(--heading-font);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: center;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    background: var(--white-color);
    border: 1px solid #e5e7eb;
    cursor: pointer;
    font-family: var(--body-font);
    font-size: var(--font-size-sm);
    font-weight: 500;
    min-height: 60px;
    padding: 0.5rem;
    position: relative;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.calendar-day.empty {
    background: #f9fafb;
    cursor: default;
}

.calendar-day.past {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day.available {
    background: rgba(var(--secondary-lilac-rgb), 0.1);
    border-color: var(--secondary-lilac);
    color: var(--dark-text);
}

.calendar-day.available:hover {
    background: rgba(var(--primary-purple-rgb), 0.1);
    border-color: var(--primary-purple);
    transform: scale(1.05);
}

.calendar-day.booked {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
    color: #dc2626;
    cursor: not-allowed;
}

.calendar-day.unavailable {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white-color);
    transform: scale(1.05);
}

.availability-indicator {
    background: var(--primary-purple);
    border-radius: 50%;
    color: var(--white-color);
    font-size: 0.7rem;
    font-weight: bold;
    height: 18px;
    line-height: 18px;
    position: absolute;
    right: 2px;
    top: 2px;
    width: 18px;
}

.calendar-day.selected .availability-indicator {
    background: var(--white-color);
    color: var(--primary-purple);
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.legend-item {
    align-items: center;
    display: flex;
    font-size: var(--font-size-sm);
    gap: 0.5rem;
}

.legend-color {
    border-radius: 50%;
    height: 12px;
    width: 12px;
}

.legend-color.available {
    background: var(--secondary-lilac);
}

.legend-color.booked {
    background: #ff6b6b;
}

.legend-color.unavailable {
    background: #9ca3af;
}

/* Time Slots Section */
.time-slots-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(var(--dark-text-rgb), 0.1);
}

.selected-date-title {
    color: var(--primary-purple);
    font-family: var(--heading-font);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.time-slot {
    background: rgba(var(--secondary-lilac-rgb), 0.1);
    border: 2px solid var(--secondary-lilac);
    border-radius: 6px;
    color: var(--dark-text);
    cursor: pointer;
    font-family: var(--heading-font);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.time-slot:hover {
    background: rgba(var(--primary-purple-rgb), 0.1);
    border-color: var(--primary-purple);
    transform: translateY(-2px);
}

.time-slot.selected {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white-color);
}

.time-slot:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

.loading-slots {
    color: var(--dark-text);
    font-style: italic;
    padding: 2rem;
    text-align: center;
}

.no-slots-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 6px;
    color: #dc2626;
    padding: 1.5rem;
    text-align: center;
}

.no-slots-message p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-display-section {
        padding: 1rem;
    }
    
    .calendar-widget {
        padding: 1rem;
    }
    
    .calendar-header {
        margin-bottom: 1rem;
    }
    
    .calendar-title {
        font-size: var(--font-size-lg);
    }
    
    .calendar-nav {
        height: 36px;
        width: 36px;
        font-size: var(--font-size-base);
    }
    
    .calendar-day {
        min-height: 50px;
        font-size: 0.8rem;
    }
    
    .weekday {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .time-slot {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .calendar-legend {
        gap: 0.75rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .calendar-display-section h3 {
        font-size: var(--font-size-lg);
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 0.25rem;
    }
    
    .availability-indicator {
        height: 16px;
        width: 16px;
        line-height: 16px;
        font-size: 0.6rem;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calendar-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Integration with Booking Form */
.booking-system-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .booking-system-container {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    
    .calendar-display-section {
        order: 1;
    }
    
    .booking-form-section {
        order: 2;
    }
}

/* Form Integration Styles */
.booking-form-section .form-group input[type="date"] {
    background: rgba(var(--secondary-lilac-rgb), 0.1);
    border: 2px solid var(--secondary-lilac);
}

.booking-form-section .form-group select#appointment_time {
    background: rgba(var(--secondary-lilac-rgb), 0.1);
    border: 2px solid var(--secondary-lilac);
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .calendar-day,
    .time-slot,
    .calendar-nav {
        transition: none;
    }
    
    .calendar-day:hover,
    .time-slot:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .calendar-day {
        border-width: 2px;
    }
    
    .calendar-day.available {
        background: #ffffff;
        border-color: #000000;
    }
    
    .calendar-day.selected {
        background: #000000;
        color: #ffffff;
    }
    
    .time-slot {
        border-width: 2px;
    }
}

/* Focus Indicators */
.calendar-day:focus,
.time-slot:focus {
    outline: 3px solid var(--primary-purple);
    outline-offset: 2px;
}

/* Loading States */
.calendar-widget.loading {
    opacity: 0.7;
    pointer-events: none;
}

.calendar-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--secondary-lilac);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}/* B
ooking Messages */
.booking-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.booking-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid #22c55e;
    color: #15803d;
}

.booking-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #dc2626;
}

.booking-message p {
    margin: 0;
}

/* Contact Form Messages */
.contact-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.contact-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid #22c55e;
    color: #15803d;
}

.contact-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #dc2626;
}