
.switch {
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 4em;
    height: 2.2em;
    border-radius: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease; 
    align-self: center;
    margin-top: 5px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2a2a; 
    transition: background-color 0.4s ease;
    border-radius: 30px;
    overflow: hidden;
}


/* إعدادات الأيقونات */
.sun-icon,
.moon-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4em;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none; 
}

.sun-icon {
    right: 0.5em;
    color: black;
    opacity: 0;
    z-index: 1;
  }


.moon-icon {
  left: 0.5em;
  color: white;
}

.switch input:checked + .slider {
    background-color: white;
  }
  
  .switch input:checked + .slider .sun-icon {
    opacity: 1;
    transform: translateY(-50%) translateX(0.2em);
    color: #000 !important;
  }
  
  .switch input:checked + .slider .moon-icon {
    opacity: 0;
    transform: translateY(-50%) translateX(-2.2em) scaleX(-1);
  }

