:root {
  --primary-color: #ffffff;
  --bg-color: #f5f5f5;
  --light-bg-color: #fff;
  --text-color: #111116;
  --light-text-color: #cdccd1;
  --primary-text-color: #fff;
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  border-radius: 30px;
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  border-radius: 30px;
  background: var(--primary-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}

body {
  min-height: 100vh;

  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background-color: var(--bg-color);
  position: fixed;
  width: 100%;
}

body.dark {
  --bg-color: #878683;
  --light-bg-color: #444444;
  --text-color: #fff;
  --light-text-color: #58575c;
}

.container {
  position: relative;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  margin: auto;
  margin-top: 2%;

}

.container .card {
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.container .card {
  position: relative;
  flex: 1;
  min-height: 500px;
  height: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background-color: var(--light-bg-color);
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  overflow: hidden;
}

.container .card .text-area {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 70px;
  /* Space for footer */
}

.container .card .from,
.container .card .to {
  display: flex;
  align-items: center;
  gap: 20px;
}

.container .card .from {
  margin-right: 20px;
}

.container .card .to {
  margin-left: 20px;
}

.container .card .heading {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--light-text-color);
  white-space: nowrap;
}

.dropdown-container {
  position: relative;
  margin-bottom: 10px;
  width: 100%;
}

.dropdown-container .dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-radius: 30px;
  background-color: var(--bg-color);
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  margin-top: 10px;
}

.dropdown-container .dropdown-toggle span {
  flex: 1;
  margin-left: 10px;
}

.dropdown-container .dropdown-toggle ion-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.clear-icon {
  margin-left: 10px;
  cursor: pointer;
}

.dropdown-container.active .dropdown-toggle {
  border-radius: 20px 20px 0 0;
}

.dropdown-container.active .dropdown-toggle ion-icon:last-child {
  transform: rotate(180deg);
}

.dropdown-container .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 300px;
  overflow: auto;
  display: none;
  padding: 20px;
  z-index: 1;
  list-style: none;
  flex-direction: column;
  background-color: var(--bg-color);
  transition: all 1s;
  border-radius: 0 0 20px 20px;
}

.dropdown-container .dropdown-menu::-webkit-scrollbar {
  display: none;
}

.dropdown-container.active .dropdown-menu {
  display: flex;
}

.dropdown-container .dropdown-menu li {
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--light-bg-color);
  transition: all 0.3s ease;
}

.dropdown-container .dropdown-menu li:hover {
  background-color: var(--light-bg-color);
}

.dropdown-container .dropdown-menu li.active {
  color: var(--primary-text-color);
  background-color: var(--primary-color);
}

.container .text-area {
  position: relative;
}

.container .card {
  font-size: large;
}

.container textarea {
  width: 100%;
  padding: 20px;
  margin: 10px 0;
  background-color: transparent;
  resize: none;
  outline: none;
  border: none;
  color: var(--text-color);
  font-size: 20px;
}

.container .text-area .chars {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 10px;
  font-size: 0.8rem;
  color: var(--light-text-color);
}

.card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-top: 20px;
  border-top: 2px solid var(--bg-color);
  background: var(--light-bg-color);
  z-index: 2;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.card-bottom p {
  margin-bottom: 20px;
}

.card-bottom label {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  cursor: pointer;
  border-radius: 32px;
  background-color: var(--bg-color);
}

@media (max-width: 800px) {
  .container .card {
    min-height: 350px;
    height: 350px;
    max-height: 60vh;
  }
}

.card-bottom label:hover {
  color: var(--primary-text-color);
  background-color: var(--primary-color);
}

.card-bottom span {
  font-size: 15px;
  pointer-events: none;
}

.card-bottom ion-icon {
  font-size: 22px;
}

.card-bottom button {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-radius: 30px;
  border: none;
  outline: none;
  color: var(--text-color);
  cursor: pointer;
  background-color: var(--bg-color);
}

.card-bottom button:hover {
  color: var(--primary-text-color);
  background-color: var(--primary-color);
}

.container .center {
  position: relative;
}

.swap-position {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  border: 5px solid var(--bg-color);
  transition: all 0.3s;
  color: var(--primary-text-color);
  background-color: var(--primary-color);
}

.swap-position ion-icon {
  font-size: 25px;
}

.swap-position:hover {
  transform: translateX(-50%) scale(1.1);
}

.mode {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1;
}

.toggle {
  position: relative;
  cursor: pointer;
}

.toggle-track {
  width: 30px;
  height: 50px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 3px 0;
  justify-content: space-between;
  border: 1px solid var(--light-text-color);
  background-color: var(--light-bg-color);
  transition: all 0.3s ease;
}

.toggle-checkbox {
  display: none;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 25px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--primary-color);
  transition: all 0.5s;
}

.toggle input:checked~.toggle-thumb {
  transform: translateY(25px);
}

.toggle img {
  width: 20px;
  height: 20px;
}

/* Media Querries */

@media (max-width: 800px) {
  .container {
    width: 100%;
    margin-top: 20px;
    flex-direction: column;
  }

  .container .card {
    width: 100%;
  }

  .container.card .from {
    margin-right: 0;
  }

  .container.card .to {
    margin-left: 0;
  }

  .container .card .from,
  .container .card .to {
    flex-direction: column;
  }

  .swap-position {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .swap-position:hover {
    transform: translate(-50%, -50%) scale(1.1);
  }

  .swap-position ion-icon {
    transform: rotate(90deg);
  }
}




.tooltip {
  position: relative;
  display: inline-block;

}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 10px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}

.toastr {
  visibility: hidden;
  min-width: 150px;
  margin-left: -125px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 25px;
  padding: 10px;
  position: fixed;
  z-index: 1;
  right: 50%;
  bottom: 30px;
  font-size: 17px;
  transition: visibility 0s, opacity 0.5s ease-in-out;
  opacity: 5;
}

.toastr.show {
  visibility: visible;
  opacity: 1;
}

#output-text-container {
  max-height: 800px;
  overflow-y: auto;
  margin-top: 20px;
  padding: 10px;
}


#input-text {
  overflow-y: auto;
}

.translated-text {
  margin-bottom: 10px;
}

.translated-text p {
  margin: 0;
}

.translated-text {
  box-sizing: border-box;
  padding: 0.75rem 1.25rem;
  margin: 1rem 0;
  background: linear-gradient(135deg, #eceff1, #cfd8dc);
  color: #333;
  border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
  min-height: 2.5rem;
  max-width: 70%;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: transform 0.3s ease, background 0.3s ease;
}

.translated-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 15px;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: #eceff1;
  border-bottom: 0;
  margin-left: -10px;
  margin-top: -1px;
}

.translated-text:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #cfd8dc, #eceff1);
}

@media (max-width: 768px) {
  .translated-text {
    max-width: 85%;
    padding: 1rem;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .translated-text {
    max-width: 95%;
    padding: 0.75rem 1rem;
    margin: 0.5rem;
    border-radius: 1rem 1rem 1rem 0.5rem;
  }

  .translated-text::after {
    left: 10px;
  }
}

.input {
  margin-top: 2%;
  max-width: 220px;
  height: 45px;
  padding: 15px;
  border-radius: 12px;
  border: 1.5px solid lightgrey;
  outline: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0px 0px 20px -18px;
}

.input:hover {
  border: 2px solid lightgrey;
  box-shadow: 0px 0px 20px -17px;
}

.input:active {
  transform: scale(0.95);
}

.input:focus {
  border: 2px solid grey;
}


button {
  margin-left: 5px;
  margin-top: 20px;
  position: relative;
  padding: 10px 20px;

  border-radius: 7px;
  border: 1px solid rgb(61, 106, 255);
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 2px;
  background: transparent;
  color: #000000;
  overflow: hidden;
  box-shadow: 0 0 0 0 transparent;
  -webkit-transition: all 0.2s ease-in;
  -moz-transition: all 0.2s ease-in;
  transition: all 0.2s ease-in;
}

button:hover {
  background: rgb(61, 106, 255);
  box-shadow: 0 0 30px 5px rgba(0, 142, 236, 0.815);
  -webkit-transition: all 0.2s ease-out;
  -moz-transition: all 0.2s ease-out;
  transition: all 0.2s ease-out;
}

button:hover::before {
  -webkit-animation: sh02 0.5s 0s linear;
  -moz-animation: sh02 0.5s 0s linear;
  animation: sh02 0.5s 0s linear;
}

button::before {
  content: '';
  display: block;
  width: 0px;
  height: 86%;
  position: absolute;
  top: 7%;
  left: 0%;
  opacity: 0;
  background: #fff;
  box-shadow: 0 0 50px 30px #fff;
  -webkit-transform: skewX(-20deg);
  -moz-transform: skewX(-20deg);
  -ms-transform: skewX(-20deg);
  -o-transform: skewX(-20deg);
  transform: skewX(-20deg);
}

@keyframes sh02 {
  from {
    opacity: 0;
    left: 0%;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
    left: 100%;
  }
}

button:active {
  box-shadow: 0 0 0 0 transparent;
  -webkit-transition: box-shadow 0.2s ease-in;
  -moz-transition: box-shadow 0.2s ease-in;
  transition: box-shadow 0.2s ease-in;
}