/* Стили для кастомного календаря */
.custom-datepicker-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.custom-datepicker-wrapper input[type="date"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

.custom-datepicker-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 20px;
}

.custom-datepicker-input:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2348bb78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.custom-datepicker-input.active,
.custom-datepicker-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(102, 126, 234, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2348bb78' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.custom-datepicker-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

/* Календарь */
.custom-datepicker-calendar {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1000;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    min-width: 300px;
    animation: datepickerFadeIn 0.2s ease;
}

@keyframes datepickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок календаря */
.custom-datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.custom-datepicker-month-year {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.custom-datepicker-nav {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #667eea;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.custom-datepicker-nav:hover {
    background-color: #f0f0f0;
    color: #764ba2;
}

.custom-datepicker-nav:active {
    background-color: #e0e0e0;
}

/* Дни недели */
.custom-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.custom-datepicker-weekday {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    padding: 0.5rem 0;
}

/* Сетка дат */
.custom-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.custom-datepicker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.custom-datepicker-day:hover:not(.other-month) {
    background-color: #f0f0f0;
    border-color: #667eea;
}

.custom-datepicker-day.other-month {
    color: #ccc;
    cursor: default;
}

.custom-datepicker-day.today {
    background-color: #e8f4fd;
    color: #667eea;
    font-weight: 600;
    border-color: #667eea;
}

.custom-datepicker-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.custom-datepicker-day.selected:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Футер */
.custom-datepicker-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

.custom-datepicker-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-datepicker-btn:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.custom-datepicker-btn:active {
    background-color: #e8f4fd;
}

.custom-datepicker-btn.today-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.custom-datepicker-btn.today-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Адаптивность */
@media (max-width: 480px) {
    .custom-datepicker-calendar {
        min-width: 280px;
        padding: 0.75rem;
    }
    
    .custom-datepicker-day {
        font-size: 0.85rem;
    }
    
    .custom-datepicker-month-year {
        font-size: 1rem;
    }
}

