@import url('https://fonts.googleapis.com/css2?family=Livvic:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,900&display=swap"');
@import url("https://fonts.googleapis.com/css2?family=Viga:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,900&display=swap");

/* Main */

:root {
  /* COLOURS */
  --primary-color800: #822192;
  --primary-color700: #9323a8;
  --primary-color600: #af2fca;
  --primary-color600-low-opacity: #af2fca66;
  --primary-color600: #c94fe6;
  --white: #f5f5f5;
  --box-color: #ffffff;
  --main-gradient: linear-gradient(to bottom, #9e2db0, #672292);

  --black: #1e171e;
  --black: #494349;
  --grey: #7c787c;

  /* FONTS */
  --primary-font: Livvic;
  --secondary-font: Viga;

  /* SIZES */
  --radius: 26px;
  --grid-height-transition: 0.8s;
  --box-padding: 24px;
  --primary-color700-rgb: 147, 35, 168;

  /* SETTINGS */
  --background-color: var(--white);
  --text-color: var(--black);

  /* Font Sizes */
  --xxs: 10px;
  --xs: 12px;
  --s: 14px;
  --m: 16px;
  --l: 18px;
  --xl: 24px;
  --xxl: 32px;
  --xxxl: 50px;
}

/* DEFAULTS */

.container {
  display: flex;
  flex-direction: column;
  gap: 8px;

  background-color: var(--box-color);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: var(--box-padding);

  width: 100%;
}

::selection {
  background-color: #942aab;
  color: white;
}

* {
  box-sizing: border-box;
}

p,
span {
  margin: 0;
  padding: 0;
}

ul,
li {
  padding: 0;
  margin: 0;
}

/* Clearing Default Button Styles */
button {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: var(--radius);
  background-color: transparent;
  font-family: var(--primary-font);
  -webkit-tap-highlight-color: transparent;
}
button:focus {
  outline: none;
  box-shadow: none;
}
button:active {
  box-shadow: none;
  background: none;
}

h1 {
  font-size: var(--xxl);
  font-weight: 600;
  margin: 0;
  padding: 0;
  line-height: 1.1;
}

/* Clearing Default Link Styles */
a {
  text-decoration: none;
}
/* Resets for mobile browsers */
a:link,
a:visited,
a:hover,
a:active {
  text-decoration: none;
}

/* Autofilled inputs (like previously selected items) */
input:-webkit-autofill {
  box-shadow: 0 0 0px 1000px white inset;
  -webkit-box-shadow: 0 0 0px 1000px white inset;
  border-radius: var(--radius);
}
input:focus {
  outline: none;
}
input {
  font-family: var(--primary-font);
  border-radius: var(--radius);
}

/* BUTTONS */

.main-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--primary-color700);
  color: #ffffff;
  font-size: var(--m);
  font-weight: 600;
  font-family: var(--primary-font);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.main-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(175, 47, 202, 0.3);
}

.main-btn:active {
  transform: translateY(0);
}

.secondary-btn {
  font-weight: 500;
  font-size: var(--m);
  padding: 12px 20px;
  border-radius: var(--radius);
  background-color: #ffffff;
  color: var(--primary-color700);
  font-family: var(--primary-font);
  border: 1px solid var(--primary-color700);
}

.register-btn {
  font-size: var(--s);
  font-weight: 600;
  padding: 16px 32px;
  border: 2px solid var(--primary-color700);
}

.buttons-container {
  display: flex;
  gap: 12px;
}

/* ICONS */

.icon {
  box-sizing: unset;
  cursor: pointer;
  width: 20px;
  height: 20px;
  padding: 8px;
  margin: -8px;
}

/* HTML & BODY */

html {
  background-color: var(--background-color);
  overflow-x: hidden;
}

body {
  flex-direction: column;
  padding: 0;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--primary-font);
  display: flex;
  min-height: 100vh;
}

.content-wrapper {
  min-height: 100vh;
  padding: 120px;
  width: 100%;
  padding: 8vw;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  gap: clamp(24px, 4.4dvh, 32px);
}

/* NAV */

.navbar {
  gap: 32px;
  display: flex;
  justify-content: center;
  background: var(--main-gradient);
  padding: 20px 0;
  border-radius: 15px;
  border-top-left-radius: 70px;
  border-top-right-radius: 70px;
  width: 100%;
  z-index: 5;
  /* Prevent flash during page transitions */
  opacity: 1;
  transition: opacity 0.1s ease-in;
}

.nav-item {
  border-radius: var(--radius);
  gap: 4px;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  justify-content: center;
  color: white !important;
  cursor: pointer;
  padding: 24px;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background-color 0.15s ease;
}

.nav-item img {
  width: 24px;
  height: 24px;
  /* Prevent flash during page transitions */
  opacity: 1;
  transition: opacity 0.1s ease-in;
  /* Ensure images are ready */
  display: block;
}

.nav-item img[alt="Library"],
.nav-item #library-nav-flag {
  border: 2px solid white;
  border-radius: 50%;
  object-fit: cover;
  height: 24px;
  width: 24px;
}

.nav-item #library-nav-flag.shimmer-circle {
  width: 24px;
  height: 24px;
}

.nav-item p {
  margin: 0;
  font-size: var(--xs);
  font-weight: 400;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(0, 0, 0, 0.1);
}

.library-padding {
  padding: 3px 0px;
}

/* Language Picker Section */

.language-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lang-box {
  background-color: var(--box-color);
  border-radius: var(--radius);
  padding: var(--box-padding);
  max-width: 42%;
  display: flex;
  align-items: center;
  text-align: center;
  gap: 16px;
  cursor: pointer;
  height: 80px;
}

.box-text {
  font-size: var(--m);
  max-width: 19vw;
  width: min-content;
  word-wrap: break-word;
  color: var(--primary-color700);
  opacity: 0.9;
  hyphens: auto;
  overflow-wrap: break-word;
}

.flag {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  position: relative;
  flex-shrink: 0;
  /* border: 1px solid var(--primary-color700); */
  box-shadow: 0px 0px 2px var(--primary-color700);
}

.flag img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  transform: translate(-50%, -50%);
  filter: saturate(1.1) brightness(1.05);
}

.stars {
  border: none;
}

/* Language Choice Overlay */

.arrow {
  color: var(--primary-color700);
  stroke: var(--primary-color700);
}

/* Input Section */

.overlay {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 9vw;
  transition: opacity 0.2s ease;
}

.langchoice-content {
  width: 100%;
  max-width: 960px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.langchoice-input {
  border-radius: var(--radius);
  background: var(--box-color);
  padding: 24px;
  width: 100%;
  height: 77px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  display: flex;
  align-items: center;
}

.langchoice-input input[type="text"] {
  border: none;
  font-size: var(--m);
  outline: none;
  background-color: transparent;
  width: 100%;
  font-family: var(--primary-font);
}

.close-btn {
  width: 40px;
  height: 40px;
  cursor: pointer;
  opacity: 0.5;
}

.confirm-arrow {
  opacity: 0.4;
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  color: var(--primary-color700);
  stroke: var(--primary-color700);
}

.confirm-arrow:hover {
  scale: 1.1;
  transform: rotate(5deg);
}

/* Options Section */

.langchoice-options {
  border-radius: var(--radius);
  background: var(--box-color);
  padding: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: 90%;
  overflow-y: auto;
  transition: max-height var(--grid-height-transition) ease;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-list li {
  cursor: pointer;
  padding: 8px 0px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--xs);
}

.section-title p {
  opacity: 0.5;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--primary-color700);
  font-size: var(--xs);
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}

#lang-input {
  flex: 1;
}

.clear-text-btn {
  position: absolute;
  cursor: pointer;
  z-index: 1000;
  width: 16px;
  height: 16px;
  padding: 8px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.section-title p {
  margin: 0;
}

li {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  width: 100%;
  line-height: 1.5;
}

.langchoice-text {
  display: flex;
  flex-direction: column;
  opacity: 0.7;
}

small {
  opacity: 0.7;
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.1;
  }
}

.listening-placeholder::before {
  content: attr(data-placeholder);
  animation: fadeInOut 1s infinite;
  pointer-events: none;
}

/* Text Input Section */

.input-container {
  display: flex;
  gap: 8px;
  flex-direction: column;
  background-color: var(--box-color);
  border-radius: var(--radius);
  padding: var(--box-padding);
  padding-bottom: calc(var(--box-padding) + 12px);
  width: 100%;
  max-height: 170px;
  transition: transform 0.3s ease;
  cursor: text;
  position: relative;
}

.input-wrapper {
  display: flex;
  gap: 4px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.input-container.input1 {
  order: 1;
}

.input-container.input2 {
  order: 3;
}

.language-label {
  top: 22px;
  left: 22px;
}

.text-input[data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: var(--text-color);
  opacity: 0.3;
}

.text-input {
  font-family: var(--primary-font);
  color: var(--text-color);
  flex: 1;
  font-size: var(--l);
  outline: none;
  word-wrap: break-word;
  max-width: 95%;
  max-height: 90px;
  overflow: auto;
  transition: height 0.3s ease;
}

.pronunciation-box {
  opacity: 0;
  transition: opacity 0.5s ease, height 0.25s ease;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, height var(--grid-height-transition) ease;
  max-height: 100%;
}

.language-grid-item {
  color: var(--primary-color700);
  background-color: white;
  font-size: var(--s);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 5vw;
  cursor: pointer;
}

#playButton {
  opacity: 0.3;
  cursor: default;
  transition: opacity 0.3s ease;
  stroke: var(--primary-color700);
  color: var(--primary-color700);
}

#playButton.active {
  opacity: 1;
  cursor: pointer;
}

#deleteAudioButton,
#addToLibraryButton {
  z-index: 100;
  display: none;
  opacity: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  bottom: 24px;
  right: 24px;
}

#addToLibraryButton {
  right: 52px;
}

#deleteAudioButton.visible,
#addToLibraryButton.visible {
  display: block;
  opacity: 0.3;
}

#addToLibraryButton.added {
  display: block;
  opacity: 0.6;
}

#deleteAudioButton:disabled,
#addToLibraryButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phonetic {
  opacity: 0.35;
}

.char-limit {
  color: var(--black);
  opacity: 0;
  position: absolute;
  bottom: 12px;
  right: var(--box-padding);
  font-size: var(--s);
}

/* Translate Button Section */

.translate-section {
  gap: 16px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  order: 2;
}

.charges {
  display: flex;
  cursor: pointer;
  color: var(--primary-color700);
  font-size: var(--m);
  align-items: center;
}

.infinity {
  width: 20px;
  height: 20px;
}

/* Outline buttons with hover fill - shared base */
.translate-button,
.more-info-button {
  color: var(--primary-color700);
  border: 2px solid var(--primary-color700);
  border-radius: var(--radius);
  background-color: #ffffff;
  padding: 12px 32px;
  cursor: pointer;
  font-size: var(--m);
  transition: all 0.2s ease;
}

.translate-button:hover,
.more-info-button:hover {
  background-color: var(--primary-color700);
  color: #ffffff;
}

.translate-button {
  font-family: var(--secondary-font);
}

.more-info-button {
  order: 4;
  margin: 0 auto;
}

.more-info-title {
  order: 4;
  display: flex;
  align-items: center;
  margin: auto;
}

.more-info-title .line {
  width: 64px;
  height: 1px;
  opacity: 0.5;
  background: black;
  margin: 0 10px;
}

h2 {
  font-family: var(--primary-font);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--s);
  opacity: 0.8;
  padding: 0;
  margin: 0;
}

h3 {
  font-family: var(--primary-font);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 400;
  font-size: var(--s);
  opacity: 0.65;
  padding: 0;
  margin: 0;
}

/* .info-section uses .card */
.info-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  opacity: 0;
  gap: 16px;
  order: 5;
  transition: opacity 0.4s ease;
}

.clickable-phrase {
  cursor: pointer;
  color: var(--primary-color700);
  padding: 4px 8px;
  border: 1px solid var(--primary-color700);
  border-radius: var(--radius);
  fill: var(--primary-color700-rgb);
}

.info-item p {
  line-height: 2.5;
}

/* LIBRARY PAGE */

.library-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.lang-pictures {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.building-image {
  margin-right: -16px;
}

img.building-image {
  object-fit: cover;
  border-radius: var(--radius);
}

.library-flag {
  border: 7px solid white;
  border-radius: 50%;
  margin-left: -16px;
  overflow: hidden;
}

.library-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.building-image,
.library-flag {
  width: 139px;
  height: 139px;
}

.lang-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
}

.change-language-btn {
  position: absolute;
  top: 50%;
  right: -40px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.change-language-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.change-language-btn img {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.lang-name {
  gap: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lang-place-name {
  display: none;
  color: var(--black);
  font-size: var(--s);
  font-weight: 500;
  opacity: 0.3;
}

/* Use .icon-xs, .icon-sm, .icon-md, .icon-lg from utilities */

.lang-title-before {
  font-size: var(--xl);
}

.lang-title-wrapper {
  font-family: var(--secondary-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lang-title {
  line-height: 0.9;
  font-size: var(--xxxl);
}

.lang-pronounce {
  font-size: var(--l);
  opacity: 0.5;
}

.line {
  width: 100px;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.5);
}

/* SETTINGS PAGE */

/* .settings-container uses .card .page-container-sm */
.settings-container {
  padding: 16px 24px;
}

.settings-header {
  display: flex;
  justify-content: left;
  gap: 8px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
}

.settings-header h1 {
  font-size: var(--xl);
  opacity: 0.8;
  padding: 8px;
  margin: 0;
}

.settings-section {
  margin-top: 24px;
}

.settings-item {
  gap: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  border-radius: 10px;
}

.settings-item.selected {
  position: relative;
  box-shadow: inset 0 0 0 2px var(--primary-color700); /* Create an inside border */
}

.settings-item img {
  width: 24px;
  height: 24px;
  opacity: 0.7;
}

/* External link icon */
.fas.fa-external-link-alt {
  margin-left: 16px;
  font-size: var(--xs);
}

.settings-item span {
  text-decoration: none;
}

.red-icon {
  -webkit-filter: invert(23%) sepia(88%) saturate(6455%) hue-rotate(320deg)
    brightness(88%) contrast(125%);
  filter: invert(23%) sepia(88%) saturate(6455%) hue-rotate(320deg)
    brightness(88%) contrast(125%);
}

.blue-icon {
  -webkit-filter: invert(20%) sepia(100%) saturate(4000%) hue-rotate(195deg)
    brightness(90%) contrast(130%);
  filter: invert(20%) sepia(100%) saturate(4000%) hue-rotate(195deg)
    brightness(90%) contrast(130%);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background-color: #f6f6f6;
}

.restore-subscription {
  color: #007bff;
  text-align: center;
  padding-top: 24px;
}

/* Choose Voice Settings */
.choose-voice {
  display: none;
}

/* MOBILE (SMALLER) DEVICES */
@media (max-width: 768px) {
  :root {
    --box-padding: 20px;
  }
  .content-wrapper {
    padding: 24px;
    padding-bottom: 160px;
  }
  .navbar {
    padding: 0 32px;
    gap: 0;
    justify-content: space-between;
    position: fixed;
    bottom: -8px;
    left: 0;
    width: 100%;
    max-width: 100vw;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
  }

  .profile-menu-container {
    top: 12px;
    right: 12px;
  }

  .profile-icon-btn {
    width: 40px;
    height: 40px;
  }

  .profile-icon-btn img {
    width: 20px;
    height: 20px;
  }

  .profile-dropdown {
    top: 48px;
    min-width: 140px;
  }
}

/* Media Adjustments (LAPTOP, PC, DESKTOP) */
/* Large Devices */
@media (min-width: 768px) {
  body {
    flex-direction: row;
  }

  langinput-content {
    padding: 5vw;
  }

  .wrapper {
    display: flex;
    flex-direction: column;
    width: 70%;
    align-items: center;
    transition: margin-left 0.5s;
  }

  .language-section {
    max-width: 400px;
  }

  .navbar {
    padding-top: 120px;
    border-radius: 0px;
    flex-direction: column;
    width: 120px;
    justify-content: flex-start;
  }

  .nav-item p {
    font-size: var(--xs);
  }

  .library-padding {
    padding: 0;
    margin: 0;
  }

  .settings-container {
    padding: 20px 32px;
  }

  .language-grid-item {
    padding: 14px 4vw;
  }

  /* LOAD SCREEN ON LARGER DEVICES */
  .load-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--speed, 0.5s) ease;
  }

  /* Loader container for bouncing dots */
  .loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
  }

  /* Bouncing dots styling */
  .bouncing-dots {
    display: flex;
    justify-content: space-between;
    width: 60px;
  }

  /* Individual dot styling */
  .dot {
    width: 15px;
    height: 15px;
    background-color: #9423a87a;
    border-radius: 50%;
    animation: bounce 1s infinite;
  }

  .dot:nth-child(1) {
    animation-delay: 0s;
  }

  .dot:nth-child(2) {
    animation-delay: 0.2s;
  }

  .dot:nth-child(3) {
    animation-delay: 0.4s;
  }

  /* Bouncing animation */
  @keyframes bounce {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-20px);
    }
  }
}

.fade-in {
  transition: opacity 0.15s ease-in;
  opacity: 0;
}

.fade-out {
  transition: opacity 0.15s ease-out;
  opacity: 0;
}

.speed-slider {
  margin-bottom: 10px;
  width: 50px;
}

.slider-label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--s);
}

.slider-container {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none;
}

/* No Language Selected (Library) */

/* .no-lang-wrapper uses .card */
.no-lang-wrapper {
  gap: 32px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--box-padding) * 2) calc(var(--box-padding) * 3.2);
}

.no-lang-title {
  font-weight: 600;
  color: var(--primary-color700);
}

.globe {
  position: fixed;
  top: 0;
  right: 0;
  z-index: -1;
  width: 60vw;
  height: 60vw;
  max-width: 550px;
  max-height: 500px;
  filter: grayscale(100%);
  opacity: 0.15;
}

/* Loading Animation */

.loader-wrapper {
  opacity: 0.4;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pulsing-circle {
  width: 12px;
  height: 12px;
  background-color: black;
  border-radius: 50%;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.22;
  }
  50% {
    transform: scale(0.7);
    opacity: 0.44;
  }
}

/* Shimmer Placeholder Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Shimmer Placeholders - shared gradient */
.shimmer,
.shimmer-line,
.shimmer-circle {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #f0f0f0 40%,
    #e0e0e0 50%,
    #f0f0f0 60%,
    #f0f0f0 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

.shimmer {
  border-radius: var(--radius);
}

.shimmer-line {
  height: 16px;
  width: 100%;
  min-width: 40px;
  border-radius: 8px;
}

.shimmer-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* Profile Menu */
.profile-menu-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.profile-icon-btn {
  background: transparent;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.profile-icon-btn img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.profile-character {
  font-size: var(--xl);
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.profile-dropdown {
  position: absolute;
  top: 56px;
  right: 0;
  background: var(--box-color);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  overflow: hidden;
}

.profile-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text-color);
  font-family: var(--primary-font);
  font-size: var(--s);
  transition: background-color 0.15s ease;
  border: none;
}

.profile-dropdown-item:hover {
  background-color: rgba(147, 35, 168, 0.1);
}

.profile-dropdown-item img {
  width: 20px;
  height: 20px;
}

.profile-dropdown-item img[alt="Settings"] {
  filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%)
    hue-rotate(130deg) brightness(94%) contrast(86%);
}

.profile-dropdown-item span {
  font-weight: 500;
}

/* Profile Page */
.profile-page {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.profile-title {
  font-family: var(--secondary-font);
  font-size: var(--xxl);
  color: var(--primary-color700);
  text-align: center;
  margin-bottom: 40px;
}

/* .profile-section uses .card */
.profile-section {
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.profile-section + .profile-section {
  margin-top: 24px;
}

.profile-section h2 {
  font-family: var(--primary-font);
  font-size: var(--xl);
  color: var(--primary-color700);
  margin-bottom: 24px;
}

.profile-picture-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.current-profile-picture {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--main-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--xxxl);
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.current-profile-picture.updated {
  transform: scale(1.1);
}

.profile-picture-label {
  font-family: var(--primary-font);
  font-size: var(--m);
  color: var(--text-color);
  opacity: 0.7;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.character-option {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid var(--primary-color700);
  background: var(--box-color);
  font-size: var(--xxl);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.character-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 35, 168, 0.2);
}

.character-option.selected {
  background: var(--main-gradient);
  box-shadow: 0 4px 12px rgba(147, 35, 168, 0.3);
}

/* .logout-button uses .main-btn styles */
.logout-button {
  width: 100%;
  padding: 16px 32px;
  background: var(--main-gradient);
  box-shadow: 0 4px 12px rgba(147, 35, 168, 0.2);
}

/* Custom Alert Popup */
.custom-alert-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}

.custom-alert {
  background: var(--box-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 400px;
  position: relative;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(400px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-left: 4px solid var(--primary-color700);
}

.custom-alert.active {
  opacity: 1;
  transform: translateX(0);
}

.custom-alert-error {
  border-left-color: #e74c3c;
}

.custom-alert-success {
  border-left-color: #27ae60;
}

.custom-alert-info {
  border-left-color: var(--primary-color700);
}

.custom-alert-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.custom-alert-message {
  font-family: var(--primary-font);
  font-size: var(--m);
  color: var(--text-color);
  line-height: 1.5;
  flex: 1;
}

.custom-alert-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-color);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  opacity: 0.6;
  line-height: 1;
}

.custom-alert-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  opacity: 1;
}

@media (max-width: 768px) {
  .custom-alert-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .custom-alert {
    min-width: auto;
    max-width: none;
    width: 100%;
    transform: translateY(-100px);
  }

  .custom-alert.active {
    transform: translateY(0);
  }
}

/* Custom Dialogs - Shared Base */
.custom-confirm-overlay,
.custom-delete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-confirm-overlay.active,
.custom-delete-overlay.active {
  opacity: 1;
}

.custom-confirm-dialog,
.custom-delete-dialog {
  background: var(--box-color);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 300px;
  max-width: 500px;
  position: relative;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.custom-confirm-dialog.active,
.custom-delete-dialog.active {
  opacity: 1;
  transform: scale(1);
}

.custom-confirm-message,
.custom-delete-message {
  font-family: var(--primary-font);
  font-size: var(--m);
  color: var(--text-color);
  line-height: 1.5;
}

.custom-delete-subtext,
.custom-confirm-subtext {
  font-family: var(--primary-font);
  font-size: 12px;
  line-height: 1.4;
  margin-top: -8px;
  text-align: center;
}

.custom-delete-subtext {
  color: rgba(230, 46, 46, 0.7);
}

.custom-confirm-subtext {
  color: rgba(0, 0, 0, 0.5);
}

.custom-confirm-buttons,
.custom-delete-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Confirm Dialog Specific */
.custom-confirm-dialog {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.custom-confirm-button {
  background-color: var(--primary-color700);
  color: #ffffff;
  border-color: var(--primary-color700);
}

/* Delete Dialog Specific */
.custom-delete-overlay ::selection {
  background-color: #e62e2e;
  color: #ffffff;
}

.custom-delete-dialog {
  box-shadow: 0 8px 24px rgba(230, 46, 46, 0.3);
  border: 2px solid #e62e2e;
}

.custom-delete-button {
  background-color: #e62e2e;
  color: #ffffff;
  border-color: #e62e2e;
}

.custom-delete-button:hover {
  background-color: #c92626;
  border-color: #c92626;
}

.custom-delete-cancel {
  background-color: transparent;
  color: var(--text-color);
  border-color: rgba(230, 46, 46, 0.3);
}

.custom-delete-cancel:hover {
  background-color: rgba(230, 46, 46, 0.1);
  border-color: rgba(230, 46, 46, 0.5);
}

@media (max-width: 768px) {
  .profile-page {
    padding: 24px 16px;
  }

  .profile-section {
    padding: 24px;
  }

  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 12px;
  }

  .character-option {
    width: 50px;
    height: 50px;
    font-size: var(--xl);
  }

  .current-profile-picture {
    width: 100px;
    height: 100px;
    font-size: var(--xxxl);
  }
}

/* LEARN PAGE */
.learn-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* .learn-container uses .card */
.learn-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0px -2px 20px 0px rgba(0, 0, 0, 0.15);
}

.learn-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* .lesson-card uses .card .card-hover */
.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.lesson-title {
  font-size: var(--xl);
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.lesson-subtitle {
  font-size: var(--s);
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

/* .lesson-content-container uses .card */
.lesson-content-container {
  margin-top: 24px;
}

.lesson-content {
  font-size: var(--m);
  line-height: 1.6;
  color: var(--text-color);
}

.lesson-content h2 {
  font-size: var(--xl);
  font-weight: 600;
  color: var(--primary-color700);
  margin-top: 24px;
  margin-bottom: 16px;
}

.lesson-content h2:first-child {
  margin-top: 0;
}

.lesson-content p {
  margin: 8px 0;
}

.lesson-content .error {
  color: #d32f2f;
  font-weight: 500;
}

.langchoice-hint {
  font-size: var(--s);
  color: var(--grey);
  text-align: center;
  margin-top: 16px;
  padding: 0 24px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

/* ============================================
   MAP PAGE STYLES
   ============================================ */

.translator-page {
  gap: 32px;
  min-height: unset;
  padding-bottom: 24px;
}

/* Tailwind important classes */

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.space-between {
  justify-content: space-between;
}
.align-center {
  align-items: center;
}
.gap-1 {
  gap: 8px;
}
.gap-2 {
  gap: 16px;
}
.w-full {
  width: 100%;
}

/* ============================================
   CONSOLIDATED UTILITY CLASSES
   ============================================ */

.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color700);
}

/* Page Containers */
.page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.page-container-sm {
  max-width: 600px;
}

.page-container-md {
  max-width: 800px;
}

/* Flex Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons - Danger/Delete */
.btn-danger {
  padding: 12px 16px;
  font-size: var(--s);
  color: #e53935;
  background: transparent;
  border: 1px solid #e53935;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background-color: rgba(229, 57, 53, 0.1);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Buttons - Outline */
.btn-outline {
  padding: 12px 24px;
  background: transparent;
  border: 2px solid var(--primary-color700);
  color: var(--primary-color700);
  border-radius: var(--radius);
  font-size: var(--m);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(147, 35, 168, 0.1);
}

/* Overlay Base */
.overlay-base {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay-base.active {
  opacity: 1;
}

/* Popup/Dialog Base */
.popup-base {
  background: var(--box-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 300px;
  max-width: 500px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.popup-base.active {
  opacity: 1;
  transform: scale(1);
}

/* Settings Button & Popup */
.settings-icon-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.settings-icon-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-icon-btn svg {
  width: 24px;
  height: 24px;
  color: rgba(0, 0, 0, 0.6);
  transition: color 0.2s ease;
}

.settings-icon-btn:hover svg {
  color: rgba(0, 0, 0, 0.8);
}

.settings-popup {
  position: relative;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.settings-popup-close:hover {
  opacity: 1;
}

.settings-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-back-btn img {
  width: 24px;
  height: 24px;
}

.settings-popup-title {
  font-size: var(--l);
  font-weight: 600;
  font-family: var(--primary-font);
  color: var(--text-color);
  margin: 0;
}

.settings-popup-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-popup-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-popup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--m);
  font-family: var(--primary-font);
  color: var(--text-color);
  text-decoration: none;
  transition: background 0.2s ease;
  width: 100%;
  text-align: left;
}

.settings-popup-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.settings-popup-item img,
.settings-popup-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.settings-logout {
  color: var(--text-color);
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 16px;
}

.settings-profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
}

.settings-profile-character {
  font-size: 48px;
  line-height: 1;
}

.settings-profile-email {
  font-size: var(--s);
  color: var(--text-color);
  opacity: 0.7;
}

.settings-danger-zone {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: var(--m);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  transition: opacity 0.2s ease;
}

.settings-back-btn:hover {
  opacity: 0.7;
}

.settings-voice-item.selected {
  background: var(--primary-color100);
  border-color: var(--primary-color600);
}

.settings-delete-account {
  color: #e53935 !important;
}

.settings-delete-account svg {
  color: #e53935;
}

/* Icon Sizes */
.icon-xs {
  width: 16px;
  height: 16px;
}

.icon-sm {
  width: 20px;
  height: 20px;
}

.icon-md {
  width: 24px;
  height: 24px;
}

.icon-lg {
  width: 32px;
  height: 32px;
}

/* Text Utilities */
.text-muted {
  color: rgba(0, 0, 0, 0.6);
}

/* Section Header */
.section-header {
  font-size: var(--xl);
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

/* Price Display */
.price-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-amount {
  font-size: var(--xxl);
  font-weight: 700;
  color: var(--text-color);
}

.price-period {
  font-size: var(--m);
  color: rgba(0, 0, 0, 0.6);
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feature-check {
  width: 20px;
  height: 20px;
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: var(--m);
  font-weight: 500;
  color: var(--text-color);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: var(--m);
  font-family: var(--primary-font);
  color: var(--text-color);
  background: var(--box-color);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color700);
}

/* Responsive - page container mobile padding */
@media (max-width: 768px) {
  .page-container {
    padding: 16px;
  }
}
