/* 🌟 Modal Background Overlay (Initially Hidden) */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px); /* Soft blur effect */
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    opacity: 0;
    pointer-events: none; /* Prevents blocking clicks when hidden */
    -webkit-transition: opacity 0.3s ease-in-out;
    -o-transition: opacity 0.3s ease-in-out;
    transition: opacity 0.3s ease-in-out;
}

/* 🌟 Modal Box */
.modal-content {
    background: white;
    padding: 20px;
    width: 350px;
    max-width: 90%;
    border-radius: 10px;
    -webkit-box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    -webkit-transform: translateY(50px);
        -ms-transform: translateY(50px);
            transform: translateY(50px);
    -webkit-transition: -webkit-transform 0.3s ease-in-out;
    transition: -webkit-transform 0.3s ease-in-out;
    -o-transition: transform 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
}

/* 🌟 When Modal is Open */
.modal.show {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    opacity: 1;
    pointer-events: auto; /* Allows clicks when visible */
}

.modal.show .modal-content {
    -webkit-transform: translateY(0);
        -ms-transform: translateY(0);
            transform: translateY(0);
}


/* 🌟 Slide-up Animation */
@-webkit-keyframes slideUp {
    from {
        -webkit-transform: translateY(50px);
                transform: translateY(50px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
                transform: translateY(0);
        opacity: 1;
    }
}
@keyframes slideUp {
    from {
        -webkit-transform: translateY(50px);
                transform: translateY(50px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
                transform: translateY(0);
        opacity: 1;
    }
}



.modal-content button:last-child {
    background: #f44336;
}

.modal-content button:last-child:hover {
    background: #d32f2f;
}

/* 🌟 Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: 0.4s;
    -o-transition: 0.4s;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: 0.4s;
    -o-transition: 0.4s;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    -webkit-transform: translateX(24px);
        -ms-transform: translateX(24px);
            transform: translateX(24px);
}