/**
 * Virte Booking - Calendar Styles
 */

/* Calendar wrapper */
.virte-calendar-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

/* Display / trigger button */
.virte-calendar-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 15px;
    color: #666;
    user-select: none;
}

.virte-calendar-display:hover,
.virte-calendar-display:focus {
    border-color: #4CAF50;
    outline: none;
}

.virte-calendar-display.open {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.virte-calendar-display.has-value {
    color: #333;
    font-weight: 500;
}

.virte-calendar-icon {
    display: flex;
    align-items: center;
    color: #888;
}

.virte-calendar-text {
    flex: 1;
}

.virte-calendar-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.virte-calendar-display.open .virte-calendar-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.virte-calendar-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 2147483647;
    display: none;
    overflow: hidden;
}

.virte-calendar-dropdown.open {
    display: block;
    animation: virteCalFadeIn 0.2s ease;
}

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

/* Calendar header */
.virte-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.virte-cal-month-year {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.virte-cal-prev,
.virte-cal-next {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #555;
    transition: all 0.15s;
}

.virte-cal-prev:hover,
.virte-cal-next:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* Calendar grid */
.virte-calendar-grid {
    padding: 8px 12px 12px;
}

.virte-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.virte-cal-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    padding: 6px 0;
    text-transform: uppercase;
}

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

.virte-cal-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 14px;
    cursor: default;
    transition: all 0.15s;
    position: relative;
}

.virte-cal-day.empty {
    visibility: hidden;
}

.virte-cal-day.available {
    cursor: pointer;
    color: #333;
    font-weight: 500;
}

.virte-cal-day.available:hover {
    background: #E8F5E9;
    color: #2E7D32;
}

.virte-cal-day.available::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #4CAF50;
    border-radius: 50%;
}

.virte-cal-day.unavailable {
    color: #ccc;
}

.virte-cal-day.past {
    color: #ddd;
}

.virte-cal-day.today {
    border: 2px solid #4CAF50;
}

.virte-cal-day.selected {
    background: #4CAF50;
    color: #fff;
}

.virte-cal-day.selected::after {
    background: #fff;
}

/* Times panel */
.virte-calendar-times {
    padding: 12px;
}

.virte-times-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.virte-times-back {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.15s;
}

.virte-times-back:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.virte-times-date {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.virte-times-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.virte-time-slot {
    padding: 10px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
    color: #333;
}

.virte-time-slot:hover {
    border-color: #4CAF50;
    background: #E8F5E9;
    color: #2E7D32;
}

.virte-time-slot.selected {
    background: #4CAF50;
    color: #fff;
    border-color: #43A047;
}

.virte-no-times {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* Loading */
.virte-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .virte-calendar-dropdown {
        min-width: unset;
    }

    .virte-times-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .virte-cal-day {
        padding: 6px 2px;
        font-size: 13px;
    }
}
