﻿/* Calendar layout */
.calendar {
    position: relative; /* Important for absolute positioning of events */
}

.calendar-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.calendar-content {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0.5rem;
}

/* Weekday header styling */
.calendar-weekday-name {
    font-weight: bold;
    color: #343a40;
    text-align: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #000;
    background-color: #f8f9fa;
}

/* Calendar cell styling */
.calendar-cell {
    position: relative;
    min-height: 100px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

/* Day number styling */
.calendar-day-number {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 5;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Week number styling */
.calendar-cell-weeknumber {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    opacity: 0.6;
    background-color: rgba(208, 208, 208, 0.3);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Event band styling */
.event-band {
    height: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    pointer-events: auto; /* Make the band clickable */
    z-index: 15;
}

/* Occupied day styling */
.calendar-cell.occupied {
    background-color: rgba(255, 230, 230, 0.3);
}

/* Public event styling */
.calendar-cell.event-public .calendar-day-number {
    color: #418630;
}

/* Inactive day styling */
.calendar-cell.not-active {
    background-color: #f8f9fa;
    opacity: 0.6;
}

.not-active {
    opacity: 0.5;
}

/* Today's date highlight */
.calendar-cell.today {
    border: 2px solid #007bff;
}

/* Event indicator for mobile */
.event-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin: 1px;
}

/* Event count badge for mobile */
.event-count {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile event list container */
.mobile-event-list {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 15px;
}

.mobile-event-list-content {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin: 15% auto;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mobile-event-item {
    padding: 8px;
    border-left: 5px solid;
    margin-bottom: 8px;
    background-color: #f8f9fa;
}

.mobile-event-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
}

.event-indicator-container {
    position: absolute;
    bottom: 5px;
    left: 5px;
    display: flex;
    flex-wrap: wrap;
    max-width: 80%;
}

/* Responsive adjustments */
@media only screen and (max-width: 1180px) {
    .calendar-cell {
        min-height: 80px;
    }

    .calendar-day-number {
        font-size: 1.1rem;
        width: 28px;
        height: 28px;
    }

    .event-band {
        height: 22px;
        font-size: 0.75rem;
    }
}

@media only screen and (max-width: 768px) {
    .calendar-cell {
        min-height: 60px;
        padding: 3px;
        text-align: center;
        justify-content: center;
    }

    .calendar-content {
        gap: 1px;
    }

    .calendar-day-number {
        position: static;
        font-size: 1.1rem;
        width: auto;
        height: auto;
        background: none;
        margin: 0 auto;
        padding: 3px 0;
        display: block;
    }

    .event-band {
        display: none; /* Hide desktop event bands on mobile */
    }

    .calendar-cell.has-events {
        background-color: rgba(255, 230, 230, 0.3);
    }
}

/* Small mobile screens */
@media only screen and (max-width: 480px) {
    .calendar-content {
        padding: 0;
    }

    .calendar-cell {
        min-height: 40px;
        padding: 2px;
    }

    .calendar-day-number {
        font-size: 1rem;
    }

    .event-indicator {
        width: 6px;
        height: 6px;
    }

    .event-count {
        width: 15px;
        height: 15px;
        font-size: 0.6rem;
    }

    .calendar-header {
        padding: 0.3rem;
    }
}
