﻿/* Base styles for the calendar */
.calendar {
    max-width: 90vw;
    margin: auto;
    padding: 0.75rem;
    box-sizing: border-box;
}

/* Card containing the calendar grid */
.card {
    width: 100%;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* Card body with horizontal scrolling */
.card-body {
    padding: 0.5rem;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

/* Calendar grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(4rem, 1fr));
    gap: 0.3rem;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}

/* Day header */
.day-header {
    font-weight: bold;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.2rem 0;
    background: #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 4rem;
}

/* Day cell */
.day-cell {
    border: 1px solid #ccc;
    padding: 0.3rem;
    position: relative;
    min-height: 4.5rem;
    background-color: #f9f9f9;
    font-size: 0.8rem;
    box-sizing: border-box;
    min-width: 4rem;
}

/* Date label */
.date-label {
    font-weight: bold;
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
}

/* Event label */
.event-label {
    background: #dceeff;
    padding: 0.1rem 0.2rem;
    margin: 0.1rem 0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Available label */
.available {
    background: #00ff90;
    padding: 0.1rem 0.2rem;
    margin: 0.1rem 0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Add button */
.add-button {
    position: absolute;
    bottom: 0.2rem;
    right: 0.2rem;
    font-size: 0.65rem;
    padding: 0.1rem 0.2rem;
}

/* Cursor style */
.cursor-plus {
    cursor: zoom-in;
}

/* Desktop styles (screens larger than 768px) */
@media (min-width: 768px) {
    .calendar {
        max-width: 700px;
        padding: 1rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(5rem, 1fr));
        gap: 0.4rem;
        width: 100%;
    }

    .day-header {
        font-size: 0.85rem;
        padding: 0.3rem 0;
        min-width: 5rem;
    }

    .day-cell {
        min-height: 6rem;
        padding: 0.4rem;
        font-size: 0.85rem;
        min-width: 5rem;
    }

    .date-label {
        font-size: 0.95rem;
    }

    .event-label,
    .available {
        font-size: 0.8rem;
        padding: 0.15rem 0.3rem;
    }

    .add-button {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }

    /* Tooltip styling for desktop */
    .event-label[data-toggle="tooltip"] {
        cursor: help;
    }
}

/* Mobile styles (screens smaller than 768px) */
@media (max-width: 767.98px) {
    .calendar {
        max-width: 98vw;
        padding: 0.5rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, minmax(3.5rem, 1fr));
        gap: 0.2rem;
    }

    .day-header {
        font-size: 0.7rem;
        padding: 0.15rem 0;
        min-width: 3.5rem;
    }

    .day-cell {
        min-height: 3.5rem;
        padding: 0.2rem;
        font-size: 0.7rem;
        min-width: 3.5rem;
    }

    .date-label {
        font-size: 0.75rem;
    }

    .event-label,
    .available {
        font-size: 0.65rem;
        padding: 0.1rem 0.15rem;
    }

    .add-button {
        font-size: 0.6rem;
        padding: 0.1rem 0.15rem;
    }

    .calendar select {
        font-size: 0.75rem;
        padding: 0.2rem;
        max-width: 48%;
    }

    /* Disable tooltips on mobile */
    .event-label[data-toggle="tooltip"] {
        pointer-events: none;
    }
}
