/**
 * AdamSuites Calendar Widget Styles
 * Version: 2.0.0
 * Primary Color: #8B6B9E (Purple)
 */

/* ============================================================================
   Calendar Container
   ============================================================================ */

.adamsuites-calendar-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================================
   Calendar Header (Navigation)
   ============================================================================ */

.adamsuites-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #8B6B9E;
}

.adamsuites-cal-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    text-align: center;
}

.adamsuites-cal-nav {
    background: #8B6B9E;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.adamsuites-cal-nav:hover {
    background: #6d4f7d;
    transform: scale(1.05);
}

.adamsuites-cal-nav:active {
    transform: scale(0.95);
}

/* ============================================================================
   Calendar Table
   ============================================================================ */

.adamsuites-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.adamsuites-calendar-table thead th {
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.adamsuites-calendar-table tbody td {
    padding: 0;
    text-align: center;
    border: 1px solid #e5e7eb;
    height: 45px;
    vertical-align: middle;
    position: relative;
}

/* ============================================================================
   Calendar Days
   ============================================================================ */

.adamsuites-cal-day {
    cursor: pointer;
    transition: all 0.2s ease;
}

.adamsuites-cal-day .day-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
}

/* Empty cells */
.adamsuites-cal-empty {
    background: #f9fafb;
}

/* Available dates */
.adamsuites-cal-day.available {
    background: #fff;
}

.adamsuites-cal-day.available:hover .day-number {
    background: #f3f0f5;
    color: #8B6B9E;
}

/* Past dates */
.adamsuites-cal-day.past {
    opacity: 0.5;
    cursor: not-allowed;
}

.adamsuites-cal-day.past .day-number {
    color: #9ca3af;
}

/* Today */
.adamsuites-cal-day.today .day-number {
    font-weight: 700;
    color: #8B6B9E;
    border: 2px solid #8B6B9E;
}

/* Pending bookings */
.adamsuites-cal-day.booked.pending {
    background: #fef3c7;
}

.adamsuites-cal-day.booked.pending .day-number {
    color: #92400e;
    font-weight: 600;
}

/* Confirmed bookings */
.adamsuites-cal-day.booked.confirmed {
    background: #d1fae5;
}

.adamsuites-cal-day.booked.confirmed .day-number {
    color: #065f46;
    font-weight: 600;
}

/* ============================================================================
   Calendar Legend
   ============================================================================ */

.adamsuites-calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.adamsuites-calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.adamsuites-calendar-legend .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

.adamsuites-calendar-legend .legend-color.available {
    background: #fff;
}

.adamsuites-calendar-legend .legend-color.pending {
    background: #fef3c7;
}

.adamsuites-calendar-legend .legend-color.confirmed {
    background: #d1fae5;
}

/* ============================================================================
   Widget Specific Styles
   ============================================================================ */

.widget.widget_adamsuites_calendar_widget {
    margin-bottom: 30px;
}

.widget.widget_adamsuites_calendar_widget .widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B6B9E;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 640px) {
    .adamsuites-calendar-container {
        padding: 15px;
    }
    
    .adamsuites-cal-month-year {
        font-size: 16px;
    }
    
    .adamsuites-cal-nav {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .adamsuites-calendar-table thead th {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .adamsuites-calendar-table tbody td {
        height: 40px;
    }
    
    .adamsuites-cal-day .day-number {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
    
    .adamsuites-calendar-legend {
        gap: 12px;
    }
    
    .adamsuites-calendar-legend .legend-item {
        font-size: 12px;
    }
}

/* ============================================================================
   Loading State
   ============================================================================ */

.adamsuites-calendar-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.adamsuites-calendar-container.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #e5e7eb;
    border-top-color: #8B6B9E;
    border-radius: 50%;
    animation: adamsuites-spin 0.8s linear infinite;
}

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