/* Calendar Container */
.calendar-container {
    position: relative;
    font-family: 'Segoe UI', sans-serif;
    width: 300px;
    margin: 0 auto 30px;
}

/* Input Field */
.calendar-input-wrapper {
    position: relative;
    cursor: pointer;
}

.calendar-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    color: #4a5568;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.calendar-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #10b981;
    font-size: 1.2em;
}

/* Popup */
.calendar-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 100;
    display: none;
    width: 660px;
    /* Width for two months */
    border: 1px solid #e2e8f0;
}

.calendar-popup.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Header: Start/End Date Labels */
.calendar-range-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.range-label {
    flex: 1;
    text-align: center;
}

.range-label-text {
    font-size: 1.1em;
    color: #4a5568;
    font-weight: 600;
}

.range-arrow {
    color: #a0aec0;
    font-size: 1.2em;
    margin: 0 20px;
}

.selected-days-text {
    font-size: 0.8em;
    color: #718096;
    margin-top: 5px;
}

/* Months Container */
.calendar-months {
    display: flex;
    gap: 30px;
}

.calendar-month {
    flex: 1;
}

/* Month Header */
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.month-title {
    font-weight: 600;
    color: #2d3748;
}

.month-nav {
    cursor: pointer;
    color: #718096;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.month-nav:hover {
    background: #edf2f7;
    color: #2d3748;
}

/* Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.weekday-label {
    font-size: 0.85em;
    color: #718096;
    font-weight: 600;
    margin-bottom: 10px;
}

.calendar-day {
    padding: 8px 0;
    font-size: 0.9em;
    color: #2d3748;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.calendar-day:hover:not(.empty) {
    background-color: #edf2f7;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.selected {
    background-color: white;
    color: #3182ce;
    border: 2px solid #3182ce;
    font-weight: 600;
}

.calendar-day.in-range {
    background-color: #ebf8ff;
    color: #2d3748;
    border-radius: 0;
}

.calendar-day.in-range:first-child,
.calendar-day.in-range.range-start {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
}

.calendar-day.in-range:last-child,
.calendar-day.in-range.range-end {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}

/* Footer */
.calendar-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.calendar-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #718096;
    color: white;
    border: none;
}

.btn-cancel:hover {
    background: #4a5568;
}

.btn-apply {
    background: #4299e1;
    color: white;
    border: none;
}

.btn-apply:hover {
    background: #3182ce;
}

/* Year Selection */
.year-click {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.year-click:hover {
    background: #edf2f7;
    color: #3182ce;
}

.years-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.year-item {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #4a5568;
}

.year-item:hover {
    background: #edf2f7;
    color: #2d3748;
}

.year-item.selected {
    background: #3182ce;
    color: white;
    font-weight: 600;
}

/* Month Selection */
.month-click {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.month-click:hover {
    background: #edf2f7;
    color: #3182ce;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
}

.month-item {
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #4a5568;
}

.month-item:hover {
    background: #edf2f7;
    color: #2d3748;
}

.month-item.selected {
    background: #3182ce;
    color: white;
    font-weight: 600;
}