
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f5f8;
    color: #202938;
    font-family: system-ui, -apple-system, sans-serif;
}

main {
    width: 100%;
}

.calendar-app {
    width: min(100% - 32px, 1100px);
    margin: 24px auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.app-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.logout-button {
    padding: 9px 14px;
    border: 1px solid #d5dbe3;
    border-radius: 8px;
    background: white;
    color: #202938;
    cursor: pointer;
}

.calendar {
    padding: 20px;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    background: white;
}

.calendar-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.calendar-header h2 {
    margin: 0;
    text-align: center;
    font-size: 1.3rem;
    text-transform: capitalize;
}

.calendar-header button {
    width: 44px;
    height: 44px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: white;
    color: #202938;
    font-size: 1.8rem;
    cursor: pointer;
}

.calendar-header button:hover,
.logout-button:hover {
    background: #f0f3f7;
}

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

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-weekdays div {
    padding: 8px 0;
    color: #667085;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.calendar-day {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 4px;
    overflow: hidden;
    border: 1px solid #e3e7ed;
    border-radius: 7px;
    background: #fafbfc;
    color: #202938;
    cursor: pointer;
}

.calendar-day.empty {
    visibility: hidden;
    cursor: default;
}

.calendar-day:not(.empty):hover {
    outline: 2px solid #202938;
    outline-offset: -2px;
}

.day-number {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    font-weight: 600;
}

.calendar-day.today {
    outline: 2px solid #202938;
    outline-offset: -2px;
}

.day-markers {
    position: absolute;
    z-index: 2;
    bottom: 6px;
    left: 6px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
}

.day-marker {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.calendar-legend {
    margin-top: 20px;
    padding: 16px 20px;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    background: white;
}

.calendar-legend h2 {
    margin: 0 0 14px;
    font-size: 1rem;
}

#calendar-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
}

.legend-color {
    width: 13px;
    height: 13px;
    border-radius: 3px;
}

@media (max-width: 600px) {
    .calendar-app {
        width: calc(100% - 16px);
        margin: 12px auto;
    }

    .app-header {
        margin-bottom: 16px;
    }

    .calendar {
        padding: 8px 4px;
    }

    .calendar-header {
        margin-bottom: 14px;
    }

    .calendar-day {
        min-height: 65px;
        padding: 7px 2px;
        border-radius: 4px;
    }

    .calendar-weekdays,
    .calendar-days {
        gap: 2px;
    }

    .calendar-legend {
        padding: 12px;
    }
}
