/**
 * Availability Calendar Frontend Styles
 */

.availability-calendar-wrapper {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.availability-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.availability-calendar-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-controls button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.calendar-controls button:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.calendar-prev,
.calendar-next {
    font-size: 20px;
    padding: 8px 12px;
    line-height: 1;
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.calendar-view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.view-btn.active {
    background: #3788d8;
    color: #fff;
    border-color: #3788d8;
}

.view-btn:hover:not(.active) {
    background: #f5f5f5;
}

.availability-calendar-container {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.calendar-loading span {
    font-size: 16px;
    color: #666;
}

.calendar-grid {
    width: 100%;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
}

.calendar-header-cell {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    border-right: 1px solid #ddd;
}

.calendar-header-cell:last-child {
    border-right: none;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #ddd;
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid #ddd;
    position: relative;
    background: #fff;
    transition: background-color 0.2s;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #bbb;
}

.calendar-day.today {
    background: #e3f2fd;
}

.calendar-day.today .day-number {
    background: #3788d8;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.calendar-day.available {
    background: #e8f5e9;
}

.calendar-day.booked {
    background: #ffebee;
}

.calendar-day.has-events {
    cursor: pointer;
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.calendar-event {
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.calendar-event:hover {
    opacity: 0.8;
}

/* Day View */
.calendar-day-full {
    min-height: 400px;
    padding: 20px;
    border-right: none;
}

.calendar-day-full .day-number {
    font-size: 24px;
    margin-bottom: 15px;
}

.calendar-day-full .day-events {
    gap: 10px;
}

.calendar-day-full .calendar-event {
    padding: 10px;
    font-size: 14px;
    white-space: normal;
}

/* Week View */
.calendar-week .calendar-day {
    min-height: 150px;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.legend-color.available {
    background: #e8f5e9;
}

.legend-color.booked {
    background: #ffebee;
}

/* Event Modal */
.event-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.event-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.event-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.event-modal-close:hover {
    color: #000;
}

.event-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.event-modal-body {
    margin-top: 15px;
}

.event-modal-time {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.event-modal-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .availability-calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .calendar-controls,
    .calendar-view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 5px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .event-modal-content {
        margin: 20% auto;
        padding: 20px;
        max-width: 90%;
    }
}

