/* =============================================
   Verfügbarkeitskalender – Frontend Styles
   ============================================= */

#avcal-wrapper {
    max-width: 380px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

/* Header */
#avcal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #1e3a5f;
    color: #ffffff;
    user-select: none;
}

#avcal-header button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    opacity: 0.75;
    transition: opacity 0.2s;
    border-radius: 4px;
}

#avcal-header button:hover {
    opacity: 1;
    background: rgba(255,255,255,0.12);
}

#avcal-month-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    min-width: 160px;
    text-align: center;
}

/* Weekday labels */
#avcal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f4f5f7;
    border-bottom: 1px solid #e2e4e7;
    padding: 0 6px;
}

#avcal-weekdays span {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Day grid */
#avcal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    padding: 10px;
    background: #ffffff;
    min-height: 220px;
}

/* Individual day cells */
.avcal-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    position: relative;
    cursor: default;
    transition: background 0.1s;
}

/* Empty offset cells */
.avcal-day.empty {
    background: transparent;
}

/* Past days – grayed out */
.avcal-day.past {
    color: #d1d5db;
    font-weight: 400;
}

/* Today highlight */
.avcal-day.today {
    outline: 2px solid #1e3a5f;
    outline-offset: -2px;
    font-weight: 700;
}

/* Free days */
.avcal-day.free {
  background: #cceeaf;
  color: #333;
  font-weight: 400;
}
.avcal-day.free:not(.past):hover {
    background: #f3f4f6;
}

/* Booked */
.avcal-day.gebucht {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

/* Not available (maintenance / renovation) */
.avcal-day.nicht_verfuegbar {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

/* Tooltip hint (from notes field) */
.avcal-day[title] {
    cursor: help;
}

/* Loading spinner */
#avcal-grid.avcal-loading::after {
    content: '';
    grid-column: 1 / -1;
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* Legend */
#avcal-legend {
    display: flex;
    gap: 0;
    padding: 10px 12px;
    background: #f4f5f7;
    border-top: 1px solid #e2e4e7;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.avcal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.avcal-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.avcal-dot.avcal-free {
  background: #cceeaf;
  border: 1px solid #d1d5db;
}

.avcal-dot.avcal-gebucht {
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.avcal-dot.avcal-nicht-verfuegbar {
    background: #fef3c7;
    border: 1px solid #fcd34d;
}

/* Responsive */
@media (max-width: 420px) {
    #avcal-wrapper {
        max-width: 100%;
        border-radius: 8px;
    }
    .avcal-day {
        font-size: 12px;
    }
    #avcal-month-title {
        font-size: 15px;
        min-width: 130px;
    }
}
