
/* ==== position: relative ====*/

.thumb-img {
    position: relative;
    width: 300px;
    margin: 10px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0px 2px 2px -1px rgba(0, 0, 0, 0.2),
      0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

.thumb-img > .label-img {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    padding: 8px 16px;
    border-bottom-left-radius: 4px;
  
    /* font-family: sans-serif; */
    font-size: 24px;
    background-color: #2196f3;
    color: #fff;
}



/* ==== position: fixed ====*/
  
 .fixed-button {
    position: fixed;
    /* right: 30px; */
    right: 15%;
    bottom: 30px;
  
    display: inline-block;
    width: 64px;
    height: 64px;
  
    margin: 0;
    padding: 0;
    border: none;
    background-color: transparent;
  
    background-image: url("https://cdn-icons-png.flaticon.com/512/1653/1653630.png");
    background-size: contain;
  
    cursor: pointer;
  }


/* .fixed-back {
    display: inline-block;
    border: 1px solid green;
    text-decoration: none;
    border-radius: 4px;
    background-color: #d4d3f1;
    font-size: 18px;
    box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.3);

    position: fixed;
    top: 30px;
    left: 50px;
    padding: 6px 10px;
    z-index: 2;
}

.fixed-back:hover {
    background-color: #dbc4a6;
}

.fixed-back:active {
    top: 32px;
    left: 52px;
    box-shadow: none;
} */

/* === z-index === */

.z-container {
    /* min-height: 100vh; */
    height: 240px;
    position: relative;
    border: 2px dashed red;
  }

.z-box {
  position: absolute;
  height: 90px;
  width: 90px;

  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  font-size: 40px;
  color: #fff;
  border: 1px solid black;
  box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
}

.z-box:nth-child(1) {
  top: 20px;
  left: 130px;
  background-color: #1789fc;

  z-index: 2;
}

.z-box:nth-child(2) {
  top: 30px;
  left: 200px;
  background-color: #ef233c;

  z-index: 2;
}

.z-box:nth-child(3) {
  top: 110px;
  left: 190px;
  background-color: #ffd07b;
  z-index: 1;
}

.z-box:nth-child(4) {
  top: 100px;
  left: 120px;
  background-color: #4caf50;
}

/* ==== visible hidden ====*/
.box-visible {
  border: 2px solid tomato;
  width: 300px;
  height: 110px;
  /* text-decoration: ; */
}

.box-hidden {
  border: 2px solid tomato;
  width: 300px;
  height: 138px;

  overflow: hidden;
}


.box-scroll {
  border: 2px solid tomato;
  width: 300px;
  height: 138px;
  
  overflow: scroll;
}


.box-auto {
  border: 2px solid tomato;
  width: 240px;
  height: 100px;
  
  overflow: auto;
}

.thumb-hidden {
  border: 10px solid green;
  border-radius: 50px;
  width: 480px;

  overflow: hidden;
}


/* === overlay === */

.box-overlay {
  position: relative;
  width: 400px;
  height: 200px;
  /* margin: 0 auto; */
  background-color: #bdbdbd;
  overflow: hidden;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #3f51b5;

  /* transform: translatey(100%); */
  /* transform: translatey(100%); */
  /* transform: translateY(100%); */
  transform: translateX(95%);
  transition: transform 250ms ease-in-out;
}

.box-overlay:hover .overlay {
  /* transform: translatey(0); */
  /* transform: translateY(0); */
  transform: translateX(0);
}

.overlay p {
  color: #fff;
  padding: 10px;
  margin: 0;
  font-size: 18px;
}

.overlay code {
  font-size: 18px;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 2px;
  background-color: #fff;
  color: #2a2a2a;
}


/* === CSS-переходи transition === */

.container-transition {
  width: 800px;
  /* width: 100%; */
  border: 2px dashed #2a2a2a;
  border-radius: 4px;
  padding: 10px;
}

.circle {
  width: 110px;
  height: 50px;
  border-radius: 20%;
  font-size: 14px;

  display: flex;
  justify-content: center;
  align-items: center;
  
  transform: translatex(0);
  transition-property: transform;
  transition-duration: 1000ms;
  transition-delay: 200ms;
}

.circle:not(:last-child) {
  margin-bottom: 10px;
}

.circle:nth-child(1) {
  background-color: #f44336;
  transition-timing-function: linear;
}

.circle:nth-child(2) {
  background-color: #3f51b5;
  transition-timing-function: ease;
}

.circle:nth-child(3) {
  background-color: #00bcd4;
  transition-timing-function: ease-in;
}

.circle:nth-child(4) {
  background-color: #4caf50;
  transition-timing-function: ease-out;
}

.circle:nth-child(5) {
  background-color: #ffeb3b;
  transition-timing-function: ease-in-out;
}

.circle:nth-child(6) {
  background-color: #e91e63;
  transition-timing-function: cubic-bezier(0.39, 1.03, 0.82, 0.08);
}


.container-transition:hover .circle {
  /* transform: translatex(calc(100vw - 86px)); */
  transform: translatex(calc(800px - 110px - 20px)); 
  
}

/* === transition-2 === */

.container-transition-2 {
  width: 150px;
  height: 150px;
  background-color: yellowgreen;
  transition: background-color 1000ms linear 200ms, transform 200ms linear;
}

.container-transition-2:hover {
  background-color: red;
  /* transform: scale(1.1); */
  transform: rotate(90deg);
}



/* === анімації */

.img-container-keyframe {
  display: flex;
  /* align-items: center; */
  width: 1024px;
  height: 300px;
  border: 2px solid black;
}

.animation-box {
  width: 150px;
  height: 150px;
  margin: 10px auto;
  padding: 10px;
  border-radius: 10px;
  background-color: teal;
}

@keyframes animetionBgColor {
  0% {
    background-color: teal;
  }
  25% {
    background-color: orange;
  }
  50% {
    background-color: yellow;
  }
  75% {
    background-color: greenyellow;
  }
  100% {
    background-color: rgb(48, 55, 119);
  }
}

.animation-box.hov:hover {
  animation-name: animetionBgColor;
  animation-duration: 3000ms;
}

.animation-box.cons {
  /* animation-name: animetionBgColor;
  animation-duration: 3000ms;
  animation-timing-function: linear;
  animation-delay: 1000ms;
  animation-iteration-count: 5; */
      /* animation-iteration-count: infinite; */
      /* animation-direction: alternate; */
  /* animation-fill-mode: forwards; */
      /* animation-play-state: paused; */
  animation: animetionBgColor 3000ms linear 1000ms 5 forwards;
}


/* === perspective */

.perspective-wrap {
  display: flex;
}

.scene {
  height: 200px;
  width: 200px;
  border: 2px solid black;
  border-radius: 4px;
  background-color: #fff;
}

.box-per {
  height: 100%;
  border-radius: 4px;
  color: white;
  font-size: 20px;
  /*   transition: transform 0.5s ease-in-out; */
}

.rotate-x {
  /*   transform: perspective(400px) rotateX(45deg); */
  animation: rotateX 1500ms infinite alternate ease-in-out 1000ms;
  background-color: tomato;
}

.rotate-y {
  /*   transform: perspective(400px) rotateY(45deg); */
  animation: rotateY 1500ms infinite alternate ease-in-out 1000ms;
  background-color: blue;
}

/* Лише другому .scene */
.scene + .scene {
  margin-left: 50px;
}

 /* Для усіх .scene */
/* .scene {
  margin-left: 50px;
} */


@keyframes rotateX {
  0% {
    transform: perspective(400px) rotateX(0deg);
  }

  100% {
    transform: perspective(400px) rotateX(60deg);
  }
}

@keyframes rotateY {
  0% {
    transform: perspective(400px) rotateY(0deg);
  }

  100% {
    transform: perspective(400px) rotateY(60deg);
  }
}

/* === Викривлення */
.box-scew {
  width: 180px;
  height: 100px;
  border: 4px solid #050b33;
  border-radius: 10px;
  margin: 50px;
  /* margin-right: 5px; */

  animation: animateY30 3000ms infinite 1000ms;
  background-color: #03a9f4;
}

@keyframes animateY30 {
  0% {
    transform: skewX(0deg);
  }

  50% {
    transform: skewY(30deg);
  }

  100% {
    transform: skewX(0deg);
  }
}



/* === Центрування елемента */

.parent-box {
  position: relative;
  max-width: 500px;
  height: 200px;
  border: 6px solid #303f9f;
  border-radius: 10px;
  background-color: #3f51b5;
}

.center-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 100px;
  height: 100px;
  border: 6px solid #ffa000;
  border-radius: 10px;
  background-color: #ffc107;
}


/*  === Точка трансформації */

.container-origin {
  /* min-height: 100vh; */
  width: 620px;
  display: flex;
  /* flex-wrap: wrap; */
  justify-content: space-around;
  /* align-content: center; */
  margin: 50px auto;
  border: 2px solid black;
}


.box-origin {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid tomato;
  border-radius: 4px;
  font-size: 17px;
}

@keyframes rotateWithOrigin {
  0% {
    transform: rotate3d(0, 0, 1, 0deg);
  }

  100% {
    transform: rotate3d(0, 0, 1, 360deg);
  }
}

.box-origin::before {
  position: absolute;
  display: inline-block;
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.3);
  /*  Анимация  */
  animation: rotateWithOrigin 3000ms linear 1000ms infinite;
}

.box-origin:nth-child(1)::before {
  transform-origin: center left;
}

.box-origin:nth-child(2)::before {
  transform-origin: center center;
}

.box-origin:nth-child(3)::before {
  transform-origin: top right;
}


.box-origin::after {
  position: absolute;
  display: inline-block;
  content: "";
  width: 16px;
  height: 16px;
  background-color: blue;
  border-radius: 50%;
}

.box-origin:nth-child(1)::after {
  top: top;
  left: calc(16px / -2);
}

.box-origin:nth-child(2)::after {
  top: center;
  left: center;
}

.box-origin:nth-child(3)::after {
  top: calc(16px / -2);
  right: calc(16px / -2);
}