.property-calendar {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.dates-group {
    display: flex;
    align-items: center;
    flex: 2;
    min-width: 300px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 15px;
    transition: border-color 0.2s;
    margin-bottom: 20px;
}

.dates-group:focus-within {
    border-color: #00b1f1;
}

.dates-group i {
    color: #495057;
    margin-right: 10px;
    font-size: 20px;
}

#dates-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 15px;
    color: #495057;
    cursor: pointer;
}

#dates-input:focus {
    outline: none;
}

.selected-dates {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.date-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.date-item:last-child {
    border-bottom: none;
}

.date-item span:first-child {
    font-weight: 600;
    color: #495057;
}

.date-item span:last-child {
    color: #6c757d;
}

.price-details {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.price-item.total {
    border-top: 2px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: 600;
    font-size: 1.1em;
}

/* Stili per Flatpickr */
.flatpickr-calendar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: inherit;
    padding: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.flatpickr-day {
    border-radius: 4px;
    height: 40px;
    line-height: 40px;
    margin: 2px;
    max-width: none;
    width: calc(100% / 7 - 4px);
}

.flatpickr-day.selected {
    background: #00b1f1;
    border-color: #00b1f1;
}

.flatpickr-day.inRange {
    background: #e6f2ff;
    border-color: #e6f2ff;
}

.flatpickr-day.disabled {
    background: #ffebee;
    color: #d32f2f;
    text-decoration: line-through;
}

/* Nascondi l'anno nel calendario */
.flatpickr-current-month .numInputWrapper {
    display: none !important;
}

.flatpickr-current-month span.cur-month {
    margin-right: 0 !important;
}


.flatpickr-wrapper{
    width: 100%;
    border: none;
}

.flatpickr-wrapper input[type=text]{
    border: none !important;
}

.date-picker-group{
    padding: 6px 15px!important;  
}

/* Responsive */
@media (max-width: 768px) {
    .property-calendar {
        padding: 10px;
    }

    .dates-group {
        min-width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .flatpickr-calendar {
        padding: 5px;
        font-size: 14px;
        right: 0 !important;
        left: 0 !important;
        max-width: 100%;
        position: fixed !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 auto;
        height: auto;
        z-index: 999999;
    }

    .flatpickr-days {
        width: 100% !important;
    }

    .flatpickr-day {
        height: 35px;
        line-height: 35px;
        font-size: 13px;
    }

    .dayContainer {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .flatpickr-current-month {
        font-size: 16px;
        padding: 10px 0;
    }

    .flatpickr-monthSelect-months {
        font-size: 14px;
    }

    .price-details, .selected-dates {
        margin: 10px 0;
        padding: 10px;
        font-size: 14px;
    }

    .date-item, .price-item {
        flex-direction: column;
        gap: 5px;
    }

    .price-item.total {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .flatpickr-calendar {
        font-size: 13px;
    }

    .flatpickr-day {
        height: 32px;
        line-height: 32px;
        font-size: 12px;
    }

    .flatpickr-current-month {
        font-size: 14px;
    }
}

/* Overlay per mobile */
.calendar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

@media (max-width: 768px) {
    .calendar-overlay.active {
        display: block;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flatpickr-calendar.open {
    animation: fadeIn 0.3s ease-out;
}
