.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.month-year-display {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.calendar-wrapper {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border-color);
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
}
.calendar-day-header:last-child {
    border-right: none;
}

.calendar-days {
    display: contents; /* Allows children to flow into the parent's grid */
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background-color: var(--white);
    transition: background-color 0.2s ease;
}
.calendar-day:nth-child(7n) {
    border-right: none;
}
.calendar-day.other-month {
    background-color: #f3f4f6;
    color: #9ca3af;
}
.calendar-day.today {
    background-color: #eff6ff;
}
.calendar-day.today .day-number {
    background-color: var(--primary);
    color: var(--white);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: inline-block;
    cursor: default;
}

.appointments-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.appointment-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.25rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    border-left: 3px solid transparent;
}
.appointment-badge:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.appointment-badge.recur-none {
    background-color: #e0e7ff;
    color: #3730a3;
    border-left-color: #6366f1;
}
.appointment-badge.recur-daily {
    background-color: #dbeafe;
    color: #1e40af;
    border-left-color: #3b82f6;
}
.appointment-badge.recur-weekly {
    background-color: #fef3c7;
    color: #92400e;
    border-left-color: #f59e0b;
}
.appointment-badge.recur-monthly {
    background-color: #d1fae5;
    color: #065f46;
    border-left-color: #10b981;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    .appointment-badge {
        font-size: 0.65rem;
    }
    .calendar-day-header {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
}
