﻿/* Root container provided by page */
#calendar {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevents horizontal overflow */
    min-height: 0; /* prevents vertical overflow */
}

/* Calendar wrapper */
.calendar {
    font-family: system-ui, sans-serif;
    flex: 1 1 auto; /* fill available height */
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    box-sizing: border-box;

    min-width: 0; /* prevents horizontal overflow */
    min-height: 0; /* prevents vertical overflow */

    overflow: hidden;
}

.calendar-header {
    flex: 0 0 auto;
    display: flex;          /* ← required */
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #0f62fe;
    color: white;
}

    .calendar-header button {
        background: transparent;
        border: none;
        color: white;
        font-size: 18px;
        cursor: pointer;
    }

    .calendar-header-title {
        flex: 1;
        text-align: center;
        font-weight: 600;
    }

/* === Calendar Grid Container === */
.calendar-grid {
    float: none !important;
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 equal columns */
    grid-template-rows: 26px auto; /* first row 24px, rest fills remaining space */
    gap: 6px; /* spacing between cells */
    flex: 1 1 auto; /* fill remaining height */
    min-height: 0; /* prevents flex overflow issues */
    padding: 0; /* padding handled outside if needed */
    width: 100% !important; /* full width of parent */
    max-width: 100% !important;
    box-sizing: border-box; /* include padding/border in width */
    overflow: hidden; /* grid itself never scrolls */
}

    /* block if Framework7 is applying .col */
    .calendar-grid .col {
        width: 100% !important;
        max-width: 100% !important;
    }

    .calendar-grid > * {
        /*display: flex;*/ /* or block */
        width: 100%;
        height: 100%;
        justify-self: stretch;
        align-self: stretch;
    }

/* === Each Day Cell === */
.calendar-day {
    /*aspect-ratio: 1;*/ /* perfect square, disabled for mobile fit */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 8px; /* base rounded corners */
    box-sizing: border-box;
}

    /* Thin border for all non-empty days */
    .calendar-day:not(:empty) {
        border: 1px solid #ccc; /* thin light border */
        border-radius: 4px; /* matches calendar-day corners */
    }

    /* Today highlight overrides everything else */
    .calendar-day.calendar-today {
        background-color: #0f62fe; /* today */
        color: white;
        font-weight: bold;
    }

/* Day names above grid */
.calendar-day-name {
    height: 24px; /* fixed height for top row */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

/* Days of other months (padding days) */
.calendar-other-month {
    opacity: 0.3;
}

/* Event dot inside a day */
.calendar-event-dot {
    position: absolute;
    bottom: 5px; /* shifted up from bottom for visibility */
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white; /* visible on today & colored days */
}

/* Optional: ensure dot is visible on today */
.calendar-day.calendar-today .calendar-event-dot {
    background: white;
}

