/* Visual Duration Slider with Radial Progress */

#new-duration-wrapper {
    margin-block-end: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--button-background-color) 0%, var(--section-title-background-color) 100%);
    border-radius: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    grid-template-columns: 1fr;
    place-content: center;
        min-width: unset;
    width: unset;
}

.duration-range-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.duration-dates {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    gap: 1ch;
}

.duration-dates .start-date,
.duration-dates .end-date {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.duration-dates .separator {
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
}

.range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
}

/* Range Slider Styling */
#duration-requested[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 6px;
    background: linear-gradient(0deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.1) var(--progress, 0%), 
        rgba(255, 255, 255, 0.1) var(--progress, 0%), 
        rgba(255, 255, 255, 0.1) 100%
    );
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 3ch;
    height: 13ch;
    padding: 0;
    writing-mode: sideways-lr;
}

#duration-requested[type="range"]:hover {
    background: linear-gradient(0deg, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.6) var(--progress, 0%), 
        rgba(255, 255, 255, 0.15) var(--progress, 0%), 
        rgba(255, 255, 255, 0.15) 100%
    );
}

#duration-requested[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 3ch;
    height: 3ch;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#duration-requested[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#duration-requested[type="range"]::-moz-range-thumb {
    width: 3ch;
    height: 3ch;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#duration-requested[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Radial Progress Indicator */
.radial-progress {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--section-title-darker-background-color) 0deg,
        var(--section-title-darker-background-color) calc(var(--progress, 0) * 3.6deg),
        rgba(255, 255, 255, 0.5) calc(var(--progress, 0) * 3.6deg),
        rgba(255, 255, 255, 0.1) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 85%;
    height: 85%;
    border-radius: 50%;
    background-color: var(--section-title-background-color);
}

.progress-text {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.progress-text .days-used {
    font-size: 1.8rem;
}

.progress-text .days-available {
    font-size: 1rem;
    opacity: 0.9;
}

/* Period Toggle (Days/Months) */
.period-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    width: fit-content;
    margin: 0 auto;
}

.period-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

div.period-toggle > label {
    position: relative;
    z-index: 2;
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    border-right: none;
}

.period-toggle input[type="radio"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

.period-toggle input[type="radio"]:checked + label {
    color: var(--section-title-background-color);
    font-weight: 700;
}

.period-toggle .toggle-slider {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: calc(50% - 0.5rem);
    height: calc(100% - 1rem);
    background: white;
    border-radius: 1.5rem;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.period-toggle input[type="radio"]:nth-of-type(2):checked ~ .toggle-slider {
    transform: translateX(100%);
}

/* Responsive */
@media (max-width: 768px) {
    /* .range-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    } */
    
    .radial-progress {
        width: 100px;
        height: 100px;
    }
    
    .progress-text {
        font-size: 1rem;
    }
    
    .progress-text .days-used {
        font-size: 1.5rem;
    }
    
    .period-toggle label {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

