/**
 * MaticAssist Frontend Availability Styles
 * 
 * @package MaticAssist
 * @since 2.0.0
 */

/* Availability Widget Container */
.maticassist-availability-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Calendar Section */
.availability-calendar-section {
    margin-bottom: 40px;
}

.availability-calendar-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Calendar Navigation */
.calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 20px;
}

.calendar-nav {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calendar-nav:hover {
    background: #005a87;
}

.calendar-nav i {
    font-size: 14px;
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
    text-align: center;
}

/* Availability Calendar */
.availability-calendar {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding: 20px 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #0073aa #f0f0f0;
}

.availability-calendar::-webkit-scrollbar {
    height: 8px;
}

.availability-calendar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.availability-calendar::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
}

.availability-calendar::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

/* Calendar Month */
.calendar-month {
    min-width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.month-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    text-transform: capitalize;
}

/* Calendar Grid */
.calendar-grid {
    width: 100%;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
    background: #f8f9fa;
    border-radius: 6px;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    background: #fff;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.calendar-day:hover:not(.disabled):not(.empty) {
    background: #e3f2fd;
    border-color: #0073aa;
    transform: scale(1.05);
}

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

.calendar-day.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* Availability States */
.calendar-day.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.calendar-day.available:hover {
    background: #c3e6cb;
    border-color: #1e7e34;
}

.calendar-day.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
    cursor: not-allowed;
}

.calendar-day.unavailable:hover {
    background: #f8d7da;
    border-color: #dc3545;
}

.calendar-day.selected {
    background: #0073aa;
    border-color: #005a87;
    color: white;
    font-weight: 600;
}

.calendar-day.selected:hover {
    background: #005a87;
    border-color: #004a6f;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid transparent;
}

.legend-color.available {
    background: #d4edda;
    border-color: #28a745;
}

.legend-color.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
}

.legend-color.selected {
    background: #0073aa;
    border-color: #005a87;
}

/* Booking Form Section */
.booking-form-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.booking-form-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Pricing Summary */
.pricing-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #0073aa;
}

.pricing-summary h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.pricing-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.pricing-row:last-child {
    border-bottom: none;
}

.pricing-row.subtotal {
    font-weight: 600;
    border-top: 2px solid #e1e5e9;
    border-bottom: none;
    padding-top: 12px;
    margin-top: 8px;
}

.pricing-row.total {
    font-weight: 700;
    font-size: 18px;
    color: #0073aa;
    border-top: 2px solid #0073aa;
    border-bottom: none;
    padding-top: 12px;
    margin-top: 8px;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.booking-submit-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 200px;
}

.booking-submit-btn:hover {
    background: #218838;
}

.booking-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .maticassist-availability-widget {
        padding: 10px;
    }
    
    .calendar-month {
        min-width: 280px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .calendar-legend {
        gap: 15px;
    }
    
    .booking-form-section {
        padding: 20px;
    }
    
    .calendar-navigation {
        gap: 15px;
    }
    
    .current-month {
        min-width: 100px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .calendar-month {
        min-width: 260px;
        padding: 10px;
    }
    
    .calendar-day {
        font-size: 12px;
    }
    
    .calendar-day-header {
        font-size: 11px;
        padding: 6px 2px;
    }
    
    .month-title {
        font-size: 16px;
    }
    
    .availability-calendar-section h3,
    .booking-form-section h3 {
        font-size: 20px;
    }
}

/* Loading States */
.calendar-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.calendar-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

/* Success States */
.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

/* Tooltips */
.calendar-day[data-date]:hover::after {
    content: attr(data-date);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    pointer-events: none;
}

.calendar-day[data-date]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    margin-bottom: 3px;
    pointer-events: none;
}


