/* -----------------------------------
   🔄 Reset and Base Styles
----------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: radial-gradient(circle at top left, #d4a5ff, #6e8efb);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
}

/* -----------------------------------
   📦 Container Styling
----------------------------------- */
.container {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: fadeIn 1s ease-in-out;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* -----------------------------------
   🎞️ Fade-in Animation
----------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------
   📐 Section Layout
----------------------------------- */
.sectionWrapper {
  display: flex;
  gap: 25px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 300px;
}

/* -----------------------------------
   📝 Textarea Styling
----------------------------------- */
textarea {
  width: 100%;
  height: 160px;
  resize: none;
  padding: 18px;
  border-radius: 15px;
  border: none;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
  color: #333;
}

textarea:focus {
  outline: none;
  box-shadow: 0 0 12px #a777e3;
}

/* -----------------------------------
   🌐 Language Select Area
----------------------------------- */
.selectArea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(167, 119, 227, 0.2);
}

/* -----------------------------------
   🔽 Dropdown Styling
----------------------------------- */
select {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #e0c3fc, #8ec5fc);
  color: #333;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M70 90 L40 60 H100 Z' fill='%236e8efb'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

select:focus {
  outline: none;
  box-shadow: 0 0 12px #a777e3, 0 0 4px #6e8efb;
}

/* Scrollbar Styling */
select::-webkit-scrollbar {
  width: 8px;
}

select::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

select::-webkit-scrollbar-thumb {
  background: #a777e3;
  border-radius: 10px;
}

/* -----------------------------------
   🎯 Icons in Select Area
----------------------------------- */
.selectArea i {
  font-size: 18px;
  color: #6e8efb;
  cursor: pointer;
  margin-right: 10px;
  transition: transform 0.2s ease, color 0.3s ease;
}

.selectArea i:hover {
  transform: scale(1.2);
  color: #a777e3;
}

/* -----------------------------------
   🚀 Translate Button
----------------------------------- */
#transfer {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(167, 119, 227, 0.5);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

#transfer:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(167, 119, 227, 0.7);
}

/* -----------------------------------
   🌙 Dark Mode Styling
----------------------------------- */
body.dark {
  background: radial-gradient(circle at top left, #1a1a2e, #16213e);
  color: #eee;
}

body.dark .container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

body.dark textarea,
body.dark select,
body.dark .selectArea {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

body.dark select {
  background: linear-gradient(135deg, #2f2f4f, #3a3a5f);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark select option {
  background-color: #1a1a2e;
  color: #fff;
}

body.dark #transfer {
  background: linear-gradient(135deg, #3a3a5f, #6e8efb);
  box-shadow: 0 0 15px rgba(110, 142, 251, 0.4);
}

body.dark #transfer:hover {
  box-shadow: 0 0 20px rgba(110, 142, 251, 0.6);
}

/* -----------------------------------
   🌗 Dark Mode Toggle Button
----------------------------------- */
.darkToggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(167, 119, 227, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

.darkToggle:hover {
  transform: rotate(20deg) scale(1.1);
  box-shadow: 0 0 20px rgba(167, 119, 227, 0.7);
}

/* -----------------------------------
   ✨ Blinking Cursor Effect
----------------------------------- */
textarea#totext.typing::after {
  content: "|";
  animation: blink 0.8s infinite;
  margin-left: 5px;
  color: #a777e3;
  font-weight: bold;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* -----------------------------------
   🔁 Swap Button Styling
----------------------------------- */
#swapBtn {
  align-self: center;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
}

/* -----------------------------------
   📱 Responsive: Tablets (≤ 768px)
----------------------------------- */
@media (max-width: 768px) {
  .container {
    padding: 25px;
    gap: 20px;
  }

  .sectionWrapper {
    flex-direction: column;
    gap: 20px;
  }

  .section {
    min-width: 100%;
  }

  textarea {
    height: 140px;
    font-size: 15px;
    padding: 16px;
  }

  select {
    font-size: 15px;
    padding: 8px 12px;
    background-position: right 10px center;
  }

  #transfer {
    font-size: 18px;
    padding: 12px;
  }

  .darkToggle {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  #swapBtn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}
