/* Base day styling */
.calendar-day {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px;
    min-height: 110px;
    max-height: 110px;
    overflow-y: auto;
    background: #fff;
    transition: all 0.25s ease;
}

.calendar-day.dimmed {
    background: #f3f3f3;
    color: #999;
}

.calendar-day::-webkit-scrollbar {
    width: 4px;
}

.calendar-day::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.day-number {
    font-weight: bold;
    margin-bottom: 4px;
}

/* Capsule container */
.capsule-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Capsule text — final, correct version */
.capsule {
    white-space: normal !important;
    line-height: 1.2;
    overflow: hidden;
}

/* Status colors */
.capsule-future {
    background: var(--base-color);
}

.capsule-due_today {
    background: #cc6600;
}

.capsule-overdue {
    background: #cc0000;
}

.capsule-partial {
    background: #e6c300;
    color: black;
}

.capsule-paid {
    background: #28a745;
}

/* Hover effect */
.hover-shadow:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: 0.2s ease;
}

/* Mobile capsule sizing */
@media (max-width: 600px) {
    .capsule {
        font-size: 0.9rem !important;
        padding: 4px 6px !important;
        border-radius: 6px;
    }
}

/* Scroll wrapper */
.calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent squishing on mobile */
.calendar-grid {
    /* min-width: 700px; */
    transition: opacity 0.25s ease;
}

/* ---------------------- */
/* VIEW: MONTH (default)  */
/* ---------------------- */
.view-month .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.view-month .calendar-day {
    border-radius: 0;
    min-height: 90px;
    max-height: none;
}

/* ---------------------- */
/* VIEW: WEEK             */
/* ---------------------- */
.view-week .calendar-grid {
    min-width: 700px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.view-week .calendar-day {
    min-height: 140px;
}

/* ---------------------- */
/* VIEW: DAY              */
/* ---------------------- */
.view-day .calendar-grid {
    display: block;
}

.view-day .calendar-day {
    margin-bottom: 12px;
    min-height: auto;
    max-height: none;
}

/* ---------------------- */
/* MODAL                  */
/* ---------------------- */
.day-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.day-modal.hidden {
    display: none;
}

.day-modal-content {
    background: white;
    width: 70%;
    /* adjust here */
    max-height: 80%;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
}

.modal-date {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.modal-capsules .capsule {
    font-size: 1rem;
    padding: 6px 8px;
    border-radius: 6px;
}

#calendar-container {
    transition: all 0.25s ease;
}

.modal-back {
    position: absolute;
    top: 8px;
    left: 12px;
    background: #eee;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
}

.view-month .calendar-scroll {
    overflow-x: hidden;
}

.view-week .calendar-scroll {
    overflow-x: auto;
}

.view-day .calendar-scroll {
    overflow-x: hidden;
}

.day-modal:not(.hidden) {
    opacity: 1;
}

@media (hover: hover) {
    .calendar-day:hover {
        background: #fafafa;
    }
}

.day-modal-content {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}