.calendar-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 8px;
}

.calendar {
    padding: 0px;
    margin: 0px auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.calendar-table {
    width: 100%;
    /* border-collapse: collapse; */
}

.calendar-table th,
.calendar-table td {
    padding: 7px;
    text-align: center;
    height: 60px;
    vertical-align: top;
    border: 1px solid #d9d9d9;
    background: #f5f5f5;
}

.calendar-table th {
    background: #000;
    padding: 5px;
    color: #fff;
    font-weight: 500;
    height: 5px;
}

.calendar-table th.weekend {
    background: #db0000;
}

/* .day-cell {
    width: 380px;
    height: 503px;
    text-align: center;
    vertical-align: middle;
    padding: 0px;
    box-shadow: var(--box-shadow);
} */

.day-cell.current-day {
    /* box-shadow: inset 0 0 3px 1px #007bff; */
    box-shadow: inset 0 0 0 2px #2d3748;
    position: relative;
    background: #fff3b4;
}

.day-cell:hover {
    cursor: pointer;
    background: #fffdf4;
    box-shadow: inset 0 0 0 2px #707070;
}

.day-cell:hover .chinese-date {
    opacity: 1;
}

.day-cell.selected {
    box-shadow: inset 0 0 0 2px #808ba8;
    background: #fffbeb;
}

.day-cell.selected .chinese-date {
    opacity: 1;
}

.day-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
}

.day-number {
    padding-left: 2px;
    font-size: 14px;
    font-weight: normal;
    color: #333;
    align-self: flex-start;
}

.chinese-date {
    opacity: 0.8;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.heavenly-stem, .earthly-branch {
    font-size: 16px;
    padding: 0px;
}

.current-day .day-number {
    font-weight: bold;   
    color: #d32f2f;
}

.current-day .chinese-date {
    opacity: 1;
}


.day-cell.weekend {
    
}

.other-month-day, .other-month {
    color: #888;
    opacity: 0.5;
}

.prev-month-day,
.next-month-day  {
    background-color: #f8f9fa;
}

.calendar-header {
    display: flex;
    margin-block: 15px 5px;
    justify-content: space-between;
    align-items: center;
    background-color: #f5f5f5;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-header button {
    padding: 5px 8px;
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-header button:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.calendar-header .current-day-btn {
    width: auto;
    padding: 5px 12px;
    margin: 0 10px;
}


/* Для мобильных устройств */
@media screen and (max-width: 480px) {

    .calendar-table td {
        height: 30px;
        padding: 8px;
    }
    
    .calendar-table th {
        padding: 4px 2px;
    }
    
    .day-number {
        padding-left: 0px;
        font-size: 10px;
    }
    
    .heavenly-stem, .earthly-branch {
        font-size: 13px;
    }
}

.calendar-wrapper {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 1, 1);
    max-height: 800px;
}

/* Скрытое состояние */
.calendar-wrapper.collapsed {
    max-height: 0;
}    

.error-cell {
    color: red;
    text-align: center;
    padding: 20px;
}