/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-weight: 400;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #222222 !important;
  color: #ffffff;
  overflow: hidden;
}

.app {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: transparent;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  box-shadow: none;
  position: relative;
}

.logo {
  margin: 0;
  color: #1CE783;
  font-size: 2.25rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.logo:hover {
  color: #35FF98;
}

.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.2s ease;
}

.icon-button:hover {
  background-color: #444;
}

/* Exclude sound button from icon-button hover effects */
.icon-button.sound-button:hover {
  background-color: transparent !important;
}

.icon-button svg {
  display: block;
  shape-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-button svg path {
  fill: #ffffff;
  vector-effect: non-scaling-stroke;
}

.profile-button {
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Sign In Button */
.sign-in-button {
  min-width: 105px;
  height: 40px;
  padding: 0px 12px;
  background: transparent;
  color: white;
  border: 1px solid rgb(102, 102, 102);
  border-radius: 20px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: 0.2s;
}

.sign-in-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgb(150, 150, 150);
}

.sign-in-button:focus {
  outline: none;
  box-shadow: none;
}

/* Desktop: keep original SVG size */
.sign-in-button svg {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex-shrink: 0;
}

/* Mobile: smaller sign-in button */
@media (max-width: 480px) {
  .sign-in-button {
    min-width: 80px !important;
    width: 80px !important;
    height: 36px !important;
    padding: 0 8px !important;
    gap: 4px !important;
    font-size: 0.9rem !important;
    border-radius: 18px !important;
  }
  
  .sign-in-button svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    flex-shrink: 0 !important;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  display: flex;
  pointer-events: auto;
}

.modal-overlay.active .modal-content {
  pointer-events: auto;
}

/* Modal Content */
.modal-content {
  background: #2c2c2c;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #fff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #555;
  border-radius: 8px;
  background-color: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #1CE783;
}

.form-input::placeholder {
  color: #888;
}

.login-button {
  width: 100%;
  padding: 0.75rem;
  background-color: #1CE783;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 0.5rem;
}

.login-button:hover {
  background-color: #35FF98;
}

.register-link {
  text-align: center;
  margin-top: 1.5rem;
  color: #888;
  font-size: 0.9rem;
}

.register-link a {
  color: #1CE783;
  text-decoration: none;
  font-weight: 500;
}

.register-link a:hover {
  text-decoration: underline;
}

.profile-avatar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Word Display Container */
.word-display-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0 1rem 1rem 1rem;
  padding-top: 2rem;
  min-height: 451x;
  flex: 1;
  margin-top: 0;
}

.word-display-card {
  background: #252525 !important;
  backdrop-filter: blur(10px);
  border-radius: 0 0 16px 16px;
  border: 1px solid #444;
  padding: 0 1.5rem 1.5rem 1.5rem;
  max-width: 1300px;
  min-width: 1300px;
  width: 1300px;
  min-height: 600px;
  text-align: center;
  transition: transform 0.2s ease;
  overflow: visible;
  position: relative;
}

/* Images Container */
.word-images-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 0 auto 1.5rem auto;
  padding: 0 15px 15px 15px;
  flex-wrap: nowrap;
  min-height: 160px;
  align-items: center;
  max-width: 1200px;
  width: 100%;
}

.word-image-slot {
  width: 130px;
  height: 130px;
  background: rgba(22, 22, 24, 0.3);
  border: 0.1px solid #444;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.word-image-slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.word-image-slot img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 8px;
}

/* Word Header */
.word-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
  position: relative;
}

.word-text {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  word-wrap: break-word;
  line-height: 1.2;
  text-align: center;
}

/* Transcription */
.word-transcription {
  font-size: 1.125rem;
  color: #6c757d;
  font-style: italic;
  margin-bottom: 1rem;
}

/* Answer Input - Стили из старого сайта */
.answer-section {
  margin-top: 1.5rem;
  max-width: 700px;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Стили для поля ввода ответа (скопированы из старого сайта) */
.answer-input {
  transition: all 0.3s ease !important;
  outline: none !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  color: #ff0000 !important;
  caret-color: #1CE783 !important;
}

/* Дополнительные селекторы для обеспечения красного цвета введенного текста */
input.answer-input {
  color: #ff0000 !important;
}

.answer-input:focus {
  color: #ff0000 !important;
  outline: none !important;
}

.answer-input:not(:placeholder-shown) {
  color: #ff0000 !important;
}

/* Стили для BatchWordLearning поля ввода */
.batch-answer-input {
  color: #ff0000 !important;
}

input.batch-answer-input {
  color: #ff0000 !important;
}

.batch-answer-input:focus {
  color: #ff0000 !important;
}

.batch-answer-input:not(:placeholder-shown) {
  color: #ff0000 !important;
}

/* Стили для placeholder в BatchWordLearning */
.batch-answer-input::placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.batch-answer-input::-webkit-input-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.batch-answer-input::-moz-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.batch-answer-input:-ms-input-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

/* Стили для placeholder */
.answer-input::placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.answer-input::-webkit-input-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.answer-input::-moz-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.answer-input:-ms-input-placeholder {
  color: #999999 !important;
  font-size: 18px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  opacity: 1 !important;
  text-align: left !important;
}

.answer-input:focus {
  outline: none !important;
}

.answer-input.correct {
  border-color: #28a745 !important;
}

.answer-input.incorrect {
  border-color: #dc3545 !important;
}

/* Word Description */
.word-description {
  position: absolute;
  bottom: 30px;
  left: 0.5rem;
  right: 0.5rem;
  padding: 1rem;
  background: #222222;
  border-radius: 8px;
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.3;
  z-index: 10;
}

/* Responsive */
@media (max-width: 1200px) {
  .word-display-card {
    max-width: 90%;
    min-width: auto;
    width: 90%;
  }
  
  /* Make progress bar responsive instead of hiding */
  main > div:first-child {
    width: 100% !important;
    left: 0 !important;
    transform: none !important;
    padding: 0 1rem !important;
  }
  
  main > div:first-child > div {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .logo {
    font-size: 1.75rem;
  }

  .header-nav {
    gap: 12px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .icon-button svg {
    width: 22px;
    height: 22px;
  }

  .profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .word-display-card {
    padding: 1rem;
    min-height: 350px;
  }

  .word-images-container {
    gap: 10px;
    padding: 10px;
  }

  .word-image-slot {
    width: 100px;
    height: 100px;
  }

  .word-image-slot img {
    width: 85px;
    height: 85px;
  }

  .word-text {
    font-size: 1.8rem;
  }

  .answer-section {
    max-width: 90%;
  }

  .answer-input {
    font-size: 1rem !important;
    padding: 0.875rem 3.5rem 0.875rem 1rem !important;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0.5rem 0.75rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .word-display-card {
    padding: 0.75rem;
  }

  .word-images-container {
    flex-direction: column;
    min-height: auto;
  }

  .word-image-slot {
    width: 120px;
    height: 120px;
  }

  .word-text {
    font-size: 1.5rem;
  }
}

/* Tooltip animation */
@keyframes tooltipFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.95) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

/* Profile Button Styles */
.profile-button-container {
  position: relative;
  display: inline-block;
}

.profile-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  color: white;
  font-weight: normal;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-button:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.profile-button:active {
  transform: scale(0.95);
}

.profile-button.large {
  width: 60px;
  height: 60px;
  font-size: 24px;
}

.profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 320px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
  animation: profileMenuSlideIn 0.2s ease-out;
}

.profile-menu.light {
  background: white;
  border: none;
}

.profile-menu.dark {
  background: #282828;
  border: none;
}

@keyframes profileMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-menu-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-menu.light .profile-menu-header {
  background: transparent;
  border-bottom: none;
}

.profile-menu.dark .profile-menu-header {
  background: transparent;
  border-bottom: none;
}

.profile-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: normal;
  font-size: 18px;
  flex-shrink: 0;
}

.profile-menu-info {
  flex: 1;
  min-width: 0;
}

.profile-menu-username {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu.light .profile-menu-username {
  color: #1a1a1a;
}

.profile-menu.dark .profile-menu-username {
  color: #ffffff;
}

.profile-menu-email {
  font-size: 14px;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu.light .profile-menu-email {
  color: rgb(62, 166, 255) !important;
}

.profile-menu.dark .profile-menu-email {
  color: rgb(62, 166, 255) !important;
}

.profile-menu-divider {
  height: 1px;
  margin: 0;
}

.profile-menu.light .profile-menu-divider {
  background: #e0e0e0;
}

.profile-menu.dark .profile-menu-divider {
  background: #444444;
}

.profile-menu-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: normal;
  transition: all 0.2s ease;
  border-radius: 0;
}

.profile-menu.light .profile-menu-item {
  color: #1a1a1a;
}

.profile-menu.dark .profile-menu-item {
  color: #ffffff;
}

.profile-menu.light .profile-menu-item:hover {
  background-color: #f8f9fa;
}

.profile-menu.dark .profile-menu-item:hover {
  background-color: #3a3a3a;
}

.profile-menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .profile-menu {
    min-width: 200px;
    right: -8px;
  }

  .profile-menu-header {
    padding: 12px;
  }

  .profile-menu-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .profile-menu-username {
    font-size: 14px;
  }

  .profile-menu-email {
    font-size: 12px;
  }

  .profile-menu-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Answer Section Styles - SIMPLIFIED AND VISIBLE */
.answer-section {
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    margin: 20px auto !important;
    padding: 20px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1000 !important;
}

.answer-input {
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    margin: 10px auto !important;
    padding: 15px !important;
    border: none !important;
    border-radius: 32px !important;
    background: #2b2b2b !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-family: Inter, sans-serif !important;
    outline: none !important;
}

.answer-input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.answer-input::placeholder {
    color: #999999;
    font-size: 20px;
    font-weight: 400;
    opacity: 1;
}

.answer-input:disabled {
    background: #303030;
    opacity: 0.7;
    cursor: not-allowed;
}

.answer-input.correct {
    background: #303030;
    box-shadow: 0px 4px 12px 0px rgba(40, 167, 69, 0.3), inset 0px 0px 1px 0px rgba(40, 167, 69, 0.5);
    color: #40c977;
}

.answer-input.incorrect {
    background: #303030;
    box-shadow: 0px 4px 12px 0px rgba(220, 53, 69, 0.3), inset 0px 0px 1px 0px rgba(220, 53, 69, 0.5);
    color: #ff8583;
}

.check-button {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.check-button:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.check-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Main sentence bold styling */
#mainSentenceContainer,
#mainSentenceText {
    font-weight: 700 !important;
}

#mainSentenceContainer * {
    font-weight: 700 !important;
}

/* OVERRIDE STYLES FOR ANSWER SECTION - FORCE VISIBILITY */
.answer-section {
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    margin: 20px auto !important;
    padding: 20px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1000 !important;
}

.answer-input {
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    margin: 10px auto !important;
    padding: 1em 3.5rem 1em 1rem !important;
    border: none !important;
    border-radius: 32px !important;
    background: #2b2b2b !important;
    color: #ffffff !important;
    font-size: 1.2rem !important;
    font-family: Inter, sans-serif !important;
    outline: none !important;
}

.check-button {
    display: inline-block !important;
    margin: 10px auto !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
}

.button-group {
    display: block !important;
    text-align: center !important;
    margin: 10px 0 !important;
}

/* ==================== FEEDBACK MODAL STYLES ==================== */
.feedback-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
}

.feedback-modal-overlay .feedback-modal-container {
  pointer-events: auto !important;
}

.feedback-modal-overlay::after {
  display: none !important;
}

@keyframes feedbackFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.feedback-modal-container {
  background: #282828 !important;
  border: none !important;
  border-radius: 24px !important;
  width: 800px !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  animation: feedbackSlideIn 0.3s ease-out;
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-modal-top-line {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #444444;
}

.feedback-modal-bottom-line {
  position: absolute;
  bottom: 68px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #444444;
}

.feedback-modal-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.feedback-modal-header h2 {
  margin: 0;
  color: white;
  font-size: 20px;
  font-weight: bold;
}

.feedback-modal-content {
  padding: 1rem 2rem 2rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.feedback-field-section {
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  border-radius: 8px;
}

.feedback-field-title {
  margin: 0 0 0.25rem 0;
  font-size: 16px;
  font-weight: bold;
  color: #FFFFFF;
}

.feedback-field-description {
  margin: 0 0 1rem 0;
  font-size: 13px;
  color: #AAAAAA;
  line-height: 1.5;
}

.feedback-input-container {
  position: relative;
}

.feedback-input {
  width: 100%;
  min-height: 250px;
  padding: 12px 16px;
  padding-bottom: 30px;
  border: 0.1px solid #444;
  border-radius: 8px;
  background: #202020;
  color: #FFFFFF;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.feedback-input:focus {
  outline: none;
  border-color: #ffffff;
}

.feedback-input:hover {
  border-color: #ffffff;
}

.feedback-input::placeholder {
  color: #666;
}

.feedback-char-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 12px;
  color: #666;
}

.feedback-modal-footer {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 1rem;
}

.feedback-btn {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-btn-secondary {
  background: #3e3e3e;
  color: #e0e0e0;
  border: none;
}

.feedback-btn-secondary:hover:not(:disabled) {
  background: #4e4e4e;
}

.feedback-btn-primary {
  background: #3e3e3e;
  color: #888;
  border: none;
}

.feedback-btn-primary:not(.disabled) {
  background: #ffffff;
  color: #000000;
  border: none;
}

.feedback-btn-primary:not(.disabled):hover {
  background: #e0e0e0;
}

.feedback-btn-primary.disabled,
.feedback-btn-primary:disabled {
  background: #3e3e3e;
  color: #888;
  border: none;
  cursor: not-allowed;
}

.feedback-modal-container.light .feedback-btn-primary.disabled,
.feedback-modal-container.light .feedback-btn-primary:disabled {
  background: #e0e0e0;
  color: #999;
  border-color: #ddd;
}


/* ==================== DARK SCROLLBAR FOR PROFILE SETTINGS ==================== */

/* Темный скроллбар для Profile Settings modal */
#profileSettingsContent {
  scrollbar-width: auto;
  scrollbar-color: #aaaaaa #282828;
}

#profileSettingsContent::-webkit-scrollbar {
  width: 16px;
}

#profileSettingsContent::-webkit-scrollbar-track {
  background: #282828;
  border-radius: 0;
}

#profileSettingsContent::-webkit-scrollbar-thumb {
  background-color: #aaaaaa;
  border-radius: 8px;
  border: 4px solid #282828;
}

#profileSettingsContent::-webkit-scrollbar-thumb:hover {
  background-color: #bbbbbb;
}

#profileSettingsContent::-webkit-scrollbar-thumb:active {
  background-color: #cccccc;
}

/* Темный скроллбар для всех модальных окон с темной темой */
.modal-content.dark,
.feedback-modal-content {
  scrollbar-width: auto;
  scrollbar-color: #aaaaaa #282828;
}

.modal-content.dark::-webkit-scrollbar,
.feedback-modal-content::-webkit-scrollbar {
  width: 16px;
}

.modal-content.dark::-webkit-scrollbar-track,
.feedback-modal-content::-webkit-scrollbar-track {
  background: #282828;
  border-radius: 0;
}

.modal-content.dark::-webkit-scrollbar-thumb,
.feedback-modal-content::-webkit-scrollbar-thumb {
  background-color: #aaaaaa;
  border-radius: 8px;
  border: 4px solid #282828;
}

.modal-content.dark::-webkit-scrollbar-thumb:hover,
.feedback-modal-content::-webkit-scrollbar-thumb:hover {
  background-color: #bbbbbb;
}

.modal-content.dark::-webkit-scrollbar-thumb:active,
.feedback-modal-content::-webkit-scrollbar-thumb:active {
  background-color: #cccccc;
}
/* Copy success message animation */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    20%, 80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.copy-success-message {
    animation: fadeInOut 2s ease-in-out;
}

/* Sound button specific styles */
.sound-button {
    color: #bebebe !important;
    opacity: 1.0 !important;
    background: none !important;
}

.sound-button:hover {
    opacity: 1 !important;
    background: none !important;
    color: white !important;
}

/* More specific selector to override any other styles */
button.sound-button {
    color: #bebebe !important;
    opacity: 1.0 !important;
}

button.sound-button:hover {
    color: white !important;
    opacity: 1 !important;
}


/* Google Sign In Button Icon Hover Effect */
.google-signin-item .google-icon-outline {
  display: block;
}

.google-signin-item .google-icon-filled {
  display: none;
}

.google-signin-item:hover .google-icon-outline {
  display: none;
}

.google-signin-item:hover .google-icon-filled {
  display: block;
}


/* Discord Sign In Button Icon Hover Effect */
.discord-signin-item .discord-icon-outline {
  display: block;
}

.discord-signin-item .discord-icon-filled {
  display: none;
}

.discord-signin-item:hover .discord-icon-outline {
  display: none;
}

.discord-signin-item:hover .discord-icon-filled {
  display: block;
}


/* Ensure all sign-in icons have the same size */
.google-icon-outline,
.google-icon-filled,
.discord-icon-outline,
.discord-icon-filled {
  width: 26px !important;
  height: 26px !important;
  flex-shrink: 0;
}

/* Sign In Menu Text and Arrow Colors */
.signin-text {
  color: #bebebe;
}

.google-signin-item:hover .signin-text,
.discord-signin-item:hover .signin-text {
  color: #ffffff;
}

.signin-arrow path {
  fill: #bebebe;
}

.google-signin-item:hover .signin-arrow path,
.discord-signin-item:hover .signin-arrow path {
  fill: #ffffff;
}

/* Update outline icon stroke colors on hover */
.google-signin-item:hover .google-icon-outline path {
  stroke: #ffffff;
}

.discord-signin-item:hover .discord-icon-outline path {
  stroke: #ffffff;
}

/* Range Slider Styles - Gray color instead of blue */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #ffffff;
  outline: none;
}

/* Webkit browsers (Chrome, Safari, Edge) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #e0e0e0;
}

input[type="range"]::-webkit-slider-thumb:active {
  background: #cccccc;
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #e0e0e0;
}

input[type="range"]::-moz-range-thumb:active {
  background: #cccccc;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #ffffff;
  border: none;
}

/* IE/Edge */
input[type="range"]::-ms-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

input[type="range"]::-ms-thumb:hover {
  background: #e0e0e0;
}

input[type="range"]::-ms-thumb:active {
  background: #cccccc;
}

input[type="range"]::-ms-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #ffffff;
  border: none;
  color: transparent;
}

input[type="range"]::-ms-fill-lower {
  background: #ffffff;
  border-radius: 4px;
}

input[type="range"]::-ms-fill-upper {
  background: #ffffff;
  border-radius: 4px;
}
/* PDF Viewer Styles */
.pdf-viewer-container {
    background: #1a1a1a;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.pdf-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #c0c0c0;
    font-size: 14px;
    font-weight: 500;
}

.pdf-controls button {
    background: #444;
    border: none;
    color: #c0c0c0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.pdf-controls button:hover {
    background: #555;
    color: #fff;
    transform: translateY(-1px);
}

.pdf-viewer-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Tasks mode specific styles */
.tasks-mode .word-display-card {
    max-width: 1300px;
    min-width: 1300px;
    width: 1300px;
}

.tasks-mode .pdf-viewer-container {
    height: 580px;
    min-height: 580px;
}

/* Responsive PDF viewer */
@media (max-width: 768px) {
    .pdf-viewer-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .pdf-header {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .pdf-controls button {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Loading state for PDF */
.pdf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #888;
    font-size: 14px;
}

.pdf-loading::before {
    content: "📄";
    margin-right: 8px;
    font-size: 20px;
}
/* Task Selection Styles */
.task-selection-container {
    background: #252525;
    border-radius: 16px;
    padding: 60px 20px;
    margin: 20px 0;
}

.single-task-container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 10px !important;
    max-width: 400px !important;
}

.task-button-single {
    width: 60px !important;
    height: 60px !important;
    border: 1px solid #444 !important;
    border-radius: 16px !important;
    background: #2a2a2a !important;
    color: #c0c0c0 !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: border-color 0.2s ease !important;
}

.task-button-single:hover {
    border-color: #10b866 !important;
}

.task-button-single:active {
    border-color: #10b866 !important;
}

/* Task selection responsive */
@media (max-width: 768px) {
    .task-button-single {
        width: 100px !important;
        height: 100px !important;
        font-size: 2rem !important;
    }
    
    .task-selection-container {
        padding: 40px 15px;
    }
}

@media (max-width: 480px) {
    .task-button-single {
        width: 80px !important;
        height: 80px !important;
        font-size: 1.8rem !important;
    }
    
    .task-selection-container {
        padding: 30px 10px;
    }
}

/* Back button styles */
.pdf-controls button:first-child {
    background: #18c76f !important;
    color: white !important;
}

.pdf-controls button:first-child:hover {
    background: #16b366 !important;
    transform: translateY(-1px);
}

/* Hide progress bar and dividers in tasks mode */
body.tasks-mode #progressBar,
body.tasks-mode .progress-divider {
    display: none !important;
}




/* Notification button wrapper - force size on mobile */
@media screen and (max-width: 480px) {
  div[data-notification-icon] {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }
}

/* ============================================ */
/* MOBILE OPTIMIZATION - Word Display Card Only */
/* ============================================ */

/* Tablets and smaller devices (768px and below) */
@media screen and (max-width: 768px) {
  /* Word display card */
  .word-display-card {
    padding: 1.5rem 1rem;
    margin: 1rem;
  }

  .word-display-card h2 {
    font-size: 2rem;
  }

  .word-display-card .transcription {
    font-size: 1rem;
  }

  .word-display-card .description {
    font-size: 0.95rem;
  }

  /* Images in word card */
  .word-images {
    gap: 0.75rem;
  }

  .word-image {
    max-width: 100%;
    max-height: 180px;
  }

  /* Sound button in word card */
  .sound-button {
    width: 45px !important;
    height: 45px !important;
  }

  .sound-button svg {
    width: 32px !important;
    height: 32px !important;
  }

  /* Sentences in word card */
  .sentences-container {
    gap: 0.65rem;
  }

  .sentence-item {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* Buttons in word card */
  .action-buttons {
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .action-button {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* Mobile phones (480px and below) */
@media screen and (max-width: 480px) {
  /* Word display card */
  .word-display-card {
    padding: 1.25rem 0.75rem;
    margin: 0.75rem;
  }

  .word-display-card h2 {
    font-size: 1.5rem;
  }

  .word-display-card .transcription {
    font-size: 0.9rem;
  }

  .word-display-card .description {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  /* Main sentence/text in card - уменьшаем большой текст */
  .word-display-card p {
    font-size: 1.1rem !important;
    line-height: 1.5;
  }

  /* Any large text in the card */
  .word-display-card > div {
    font-size: 1.1rem;
  }

  /* SVG/emoji images in sentences - уменьшаем */
  .word-display-card svg,
  .word-display-card img[src*="emoji"],
  .word-display-card img[alt] {
    max-width: 1.2rem !important;
    max-height: 1.2rem !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    display: inline-block;
    vertical-align: middle;
  }

  /* Sound button in word card */
  .sound-button {
    width: 40px !important;
    height: 40px !important;
  }

  .sound-button svg {
    width: 28px !important;
    height: 28px !important;
  }

  /* Images in word card */
  .word-images {
    gap: 0.5rem;
    flex-direction: column;
  }

  .word-image {
    max-width: 100%;
    max-height: 150px;
  }

  /* Sentences in word card */
  .sentences-container {
    gap: 0.5rem;
  }

  .sentence-item {
    padding: 0.65rem;
    font-size: 0.75rem;
  }

  /* Buttons in word card */
  .action-buttons {
    gap: 0.5rem;
    flex-direction: column;
    width: 100%;
  }

  .action-button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    width: 100%;
  }
}

/* Very small phones (360px and below) */
@media screen and (max-width: 360px) {
  .word-display-card {
    padding: 1rem 0.5rem;
    margin: 0.5rem;
  }

  .word-display-card h2 {
    font-size: 1.3rem;
  }

  .word-display-card .transcription {
    font-size: 0.85rem;
  }

  .word-display-card .description {
    font-size: 0.8rem;
  }

  /* Main sentence/text in card */
  .word-display-card p {
    font-size: 1rem !important;
    line-height: 1.4;
  }

  .word-display-card > div {
    font-size: 1rem;
  }

  /* SVG/emoji images in sentences - ещё меньше */
  .word-display-card svg,
  .word-display-card img[src*="emoji"],
  .word-display-card img[alt] {
    max-width: 1rem !important;
    max-height: 1rem !important;
    width: 1rem !important;
    height: 1rem !important;
    display: inline-block;
    vertical-align: middle;
  }

  .sound-button {
    width: 36px !important;
    height: 36px !important;
  }

  .sound-button svg {
    width: 26px !important;
    height: 26px !important;
  }

  .word-image {
    max-height: 130px;
  }

  .sentence-item {
    font-size: 0.7rem;
    padding: 0.6rem;
  }

  .action-button {
    font-size: 0.85rem;
    padding: 0.55rem 0.85rem;
  }
}

/* Landscape orientation on mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .word-display-card {
    padding: 1rem;
    margin: 0.5rem;
  }

  .word-display-card h2 {
    font-size: 1.5rem;
  }

  .word-images {
    max-height: 120px;
  }

  .word-image {
    max-height: 100px;
  }

  .action-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .action-button {
    flex: 1;
    min-width: 120px;
  }
}


/* ============================================ */
/* AGGRESSIVE MOBILE STYLES - Force smaller fonts and images */
/* ============================================ */

@media screen and (max-width: 480px) {
  /* Force smaller text in word card */
  .word-display-card * {
    font-size: 0.95rem !important;
  }

  /* Main heading/word */
  .word-display-card h1,
  .word-display-card h2,
  .word-display-card h3 {
    font-size: 1.4rem !important;
  }

  /* All paragraphs and divs with text */
  .word-display-card p,
  .word-display-card div:not(.action-buttons):not(.word-images) {
    font-size: 1rem !important;
    line-height: 1.4 !important;
  }

  /* Force smaller emojis and inline images */
  .word-display-card p img,
  .word-display-card div img:not(.word-image),
  .word-display-card span img {
    max-width: 1.1rem !important;
    max-height: 1.1rem !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
  }

  /* Small text elements */
  .word-display-card small,
  .word-display-card .transcription,
  .word-display-card .description {
    font-size: 0.85rem !important;
  }

  /* Sentence items at bottom */
  .word-display-card .sentence-item,
  .word-display-card li {
    font-size: 0.75rem !important;
    padding: 0.5rem !important;
  }
}

@media screen and (max-width: 360px) {
  /* Even smaller for very small phones */
  .word-display-card * {
    font-size: 0.9rem !important;
  }

  .word-display-card h1,
  .word-display-card h2,
  .word-display-card h3 {
    font-size: 1.2rem !important;
  }

  .word-display-card p,
  .word-display-card div:not(.action-buttons):not(.word-images) {
    font-size: 0.9rem !important;
  }

  .word-display-card p img,
  .word-display-card div img:not(.word-image),
  .word-display-card span img {
    max-width: 0.95rem !important;
    max-height: 0.95rem !important;
    width: 0.95rem !important;
    height: 0.95rem !important;
  }

  .word-display-card small,
  .word-display-card .transcription,
  .word-display-card .description {
    font-size: 0.8rem !important;
  }

  .word-display-card .sentence-item,
  .word-display-card li {
    font-size: 0.7rem !important;
  }
}


/* ============================================ */
/* FINAL MOBILE FIX - Maximum priority */
/* ============================================ */

@media screen and (max-width: 480px) {
  /* Force all text to be smaller */
  .word-display-card,
  .word-display-card * {
    font-size: 0.85rem !important;
  }
  
  /* Header navigation - reduce gap between buttons */
  .header-nav,
  nav.header-nav {
    gap: 12px !important;
  }
  
  /* Notification button wrapper - match other buttons size */
  div[data-notification-icon="true"],
  div[data-notification-icon="true"][style],
  div[data-notification-icon="true"][style*="width"],
  div[data-notification-icon="true"][style*="height"] {
    width: 42px !important;
    height: 42px !important;
  }
  
  /* Mode toggle button - ensure proper size on mobile */
  #modeToggleBtn,
  #modeToggleBtn[style],
  #modeToggleBtn[style*="width"],
  #modeToggleBtn[style*="height"] {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }
  
  /* Mode toggle tooltip - optimize for mobile */
  #modeToggleTooltip {
    font-size: 0.7rem !important;
    padding: 6px 10px !important;
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Icon buttons - remove/reduce tap highlight */
  .icon-button {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    background-color: transparent !important;
  }
  
  .icon-button:active {
    background-color: transparent !important;
  }
  
  /* Notification icon wrapper - ensure transparent background */
  div[data-notification-icon="true"] {
    background-color: transparent !important;
  }
  
  /* Support dropdown - optimize for mobile */
  #supportDropdown {
    width: 90vw !important;
    max-width: 400px !important;
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 70px !important;
  }
  
  #supportDropdown h3 {
    font-size: 16px !important;
  }
  
  #supportDropdown p {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
  
  #supportDropdown img[alt="USDT QR Code"] {
    width: 140px !important;
    height: 140px !important;
  }
  
  #usdtAddress {
    font-size: 10px !important;
  }
  
  #usdtAddressContainer {
    padding: 10px !important;
  }
  
  /* Queue time notification - smaller on mobile */
  .queue-time-notification {
    font-size: 0.65rem !important;
  }
  
  /* Task answer message - adapt for mobile */
  .task-answer-message,
  div.task-answer-message,
  div[class="task-answer-message"],
  div[style*="max-width: 1300px"].task-answer-message {
    max-width: 380px !important;
    min-width: auto !important;
    width: max-content !important;
    padding: 12px 16px !important;
    bottom: 280px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box !important;
  }
  
  .task-answer-message div[style*="font-size: 1.1rem"] {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
  }
  
  .task-answer-message strong {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    display: inline !important;
  }
  
  .task-answer-message div[style*="text-align: left"] {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  
  .task-answer-message svg {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .task-answer-message span[style*="width: 34px"] {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .task-answer-message div[style*="gap: 16px"] {
    gap: 10px !important;
  }
  
  .task-answer-message div[style*="flex: 1"] {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  /* Error message from app - same adaptive width as task answer message */
  .error-message-from-app,
  div.error-message-from-app,
  div[class="error-message-from-app"],
  div[style*="max-width: 700px"].error-message-from-app,
  div[style*="min-width: 200px"].error-message-from-app {
    max-width: 380px !important;
    min-width: auto !important;
    width: max-content !important;
    padding: 12px 16px !important;
    bottom: 280px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box !important;
  }
  
  .error-message-from-app div[style*="font-size: 1.1rem"] {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
  }
  
  .error-message-from-app strong {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    display: inline !important;
  }
  
  .error-message-from-app div[style*="text-align: left"] {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  
  .error-message-from-app svg {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .error-message-from-app span[style*="width: 34px"] {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .error-message-from-app div[style*="gap: 16px"] {
    gap: 10px !important;
  }
  
  .error-message-from-app div[style*="flex: 1"] {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .task-answer-message div[style*="font-size: 1.1rem"] {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    line-height: 1.4 !important;
  }
  
  .task-answer-message strong {
    font-size: 0.85rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    display: inline !important;
  }
  
  .task-answer-message div[style*="text-align: left"] {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
  }
  
  .task-answer-message svg {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .task-answer-message span[style*="width: 34px"] {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    flex-shrink: 0 !important;
  }
  
  .task-answer-message div[style*="gap: 16px"] {
    gap: 10px !important;
  }
  
  .task-answer-message div[style*="flex: 1"] {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  
  /* Answer input - adapt for mobile */
  .answer-input,
  #forceAnswerInput,
  input#forceAnswerInput,
  input.answer-input {
    max-width: 380px !important;
    width: 380px !important;
    font-size: 0.9rem !important;
    padding: 0.85em 3.5rem 0.85em 0.8rem !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    margin: 0 auto !important;
  }
  
  /* Answer section container - needs relative positioning for button */
  .answer-section,
  div[style*="display: flex"][style*="flex-direction: column"] {
    max-width: 380px !important;
    width: 380px !important;
    margin: 20px auto !important;
    position: relative !important;
  }
  
  /* Parent wrapper of input - ensure relative positioning */
  #forceAnswerInput:parent,
  .answer-input:parent,
  div:has(> #forceAnswerInput),
  div:has(> .answer-input) {
    position: relative !important;
  }
  
  /* Check button - position inside input field on the right */
  #forceCheckBtn,
  div#forceCheckBtn,
  [id="forceCheckBtn"],
  div[id="forceCheckBtn"][style] {
    width: 40px !important;
    height: 40px !important;
    right: 38px !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border-radius: 0.95rem !important;
    min-width: 40px !important;
    max-width: 40px !important;
    position: absolute !important;
  }
  
  #forceCheckBtn svg,
  div#forceCheckBtn svg,
  [id="forceCheckBtn"] svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
  }
  
  /* Even more specific - override inline styles */
  div[style*="right: 8px"]#forceCheckBtn {
    right: 38px !important;
  }
  
  div[style*="width: 40px"]#forceCheckBtn {
    width: 40px !important;
    height: 40px !important;
  }
  
  /* Sentences container - reduce left padding on mobile */
  .sentences-container,
  div.sentences-container,
  div[style*="padding: 0 20px 0 300px"].sentences-container,
  div.sentences-container[style*="padding"] {
    padding: 0 20px 0 20px !important;
  }
  
  /* Also adjust left positioning to move it more to the left */
  .sentences-container,
  div.sentences-container,
  div[style*="left: 50%"].sentences-container {
    left: 45% !important;
  }
  
  /* Learning progress bars - transparent background on mobile */
  .word-learning-progress,
  div.word-learning-progress {
    background-color: transparent !important;
  }
  
  /* Check tooltip - smaller on mobile */
  #checkTooltip {
    font-size: 0.65rem !important;
    padding: 4px 7px !important;
    top: -38px !important;
  }
  
  /* All tooltips - smaller on mobile */
  div[style*="position: absolute"][style*="background-color: white"][style*="color: black"],
  div[style*="position: absolute"][style*="background: white"],
  [class*="tooltip"],
  div[id*="Tooltip"],
  div[id*="tooltip"] {
    font-size: 0.65rem !important;
    padding: 4px 7px !important;
  }
  .badge-transcription,
  .badge-topic,
  .badge-difficulty,
  [class*="badge-"] {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
  }
  
  /* Learning bars - уменьшаем ширину */
  .learning-bar,
  #learningBar1,
  #learningBar2 {
    width: 120px !important;
    max-width: 120px !important;
  }
  
  /* Word header - уменьшаем верхний отступ */
  .word-header {
    margin-top: 2rem !important;
  }
  
  /* Progress bar - оптимизация для мобильных */
  [class*="progress"] {
    font-size: 0.75rem !important;
  }
  
  [class*="progress-container"],
  [class*="progress-wrapper"] {
    padding: 0.5rem !important;
    flex-wrap: wrap !important;
  }
  
  [class*="progress-text"],
  [class*="progress-label"] {
    font-size: 0.7rem !important;
  }
  
  [class*="progress-bar"] {
    min-width: 100px !important;
    flex: 1 !important;
  }
  
  [class*="progress-level"] {
    font-size: 0.7rem !important;
  }
  
  /* Sentence items MUST be smaller */
  .sentence-item,
  .word-display-card .sentence-item,
  [class*="sentence"] {
    font-size: 0.7rem !important;
    padding: 0.5rem !important;
  }
  
  /* All images and emojis smaller */
  .word-display-card img {
    max-width: 1rem !important;
    max-height: 1rem !important;
    width: auto !important;
    height: auto !important;
  }
}

@media screen and (max-width: 360px) {
  /* Even smaller badges for very small phones */
  .badge-transcription,
  .badge-topic,
  .badge-difficulty,
  [class*="badge-"] {
    font-size: 0.7rem !important;
    padding: 5px 10px !important;
  }
  
  /* Learning bars - ещё меньше для маленьких экранов */
  .learning-bar,
  #learningBar1,
  #learningBar2 {
    width: 100px !important;
    max-width: 100px !important;
  }
  
  /* Word header - ещё меньше отступ */
  .word-header {
    margin-top: 1.5rem !important;
  }
  
  /* Progress bar - ещё меньше для маленьких экранов */
  [class*="progress"] {
    font-size: 0.7rem !important;
  }
  
  [class*="progress-container"],
  [class*="progress-wrapper"] {
    padding: 0.4rem !important;
  }
  
  [class*="progress-text"],
  [class*="progress-label"],
  [class*="progress-level"] {
    font-size: 0.65rem !important;
  }
  
  [class*="progress-bar"] {
    min-width: 80px !important;
  }
  
  .sentence-item,
  .word-display-card .sentence-item,
  [class*="sentence"] {
    font-size: 0.65rem !important;
  }
}


/* ============================================ */
/* PROGRESS BAR WIDTH CONSTRAINT - Match word-display-card */
/* ============================================ */

/* Progress bar container - constrain to same width as word-display-card */
main.word-display-container > div[style*="position: fixed"] > div[style*="min-width: 1400px"] {
  max-width: 1400px !important;
  margin: 0 auto !important;
}

/* Progress text container - constrain width */
main.word-display-container div[style*="justify-content: space-between"][style*="padding: 22px"] {
  max-width: 1400px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* Mobile progress bar optimization */
@media screen and (max-width: 768px) {
  /* Remove padding from main container */
  main.word-display-container {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Progress bar fixed container - make it same width as word-display-card */
  main > div[style*="position: fixed"] {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Progress bar inner container - account for border */
  main > div[style*="position: fixed"] > div {
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Make word-display-card wider and taller on mobile */
  .word-display-card {
    max-width: 100% !important;
    width: 100% !important;
    min-width: auto !important;
    min-height: 700px !important;
    padding: 1.5rem !important;
    margin: 0 !important;
  }
  
  /* Progress text container */
  div[style*="justify-content: space-between"][style*="padding: 22px"] {
    padding: 12px 8px 8px 8px !important;
    font-size: 0.75rem !important;
  }
  
  /* Progress text elements */
  #progressCurrent,
  #progressLevel,
  #progressMax {
    font-size: 0.75rem !important;
  }
  
  /* Progress bar height */
  div[style*="position: relative; height: 50px"] {
    height: 40px !important;
  }
  
  /* Progress bar track */
  div[style*="height: 16px"][style*="background-color: rgba(68, 68, 68"] {
    height: 12px !important;
  }
}

@media screen and (max-width: 480px) {
  /* Remove padding from main container */
  main.word-display-container {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding-top: 60px !important;
    position: relative !important;
  }
  
  /* Progress bar fixed container - positioned above word card */
  main > div[style*="position: fixed"] {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 400px !important;
    max-width: 400px !important;
    padding: 0 !important;
    margin: 0 !important;
    top: 60px !important;
  }
  
  /* Make word-display-card 400px width - positioned right below progress bar */
  .word-display-card {
    max-width: 400px !important;
    width: 400px !important;
    min-width: 400px !important;
    min-height: 500px !important;
    padding: 1.25rem !important;
    margin: 0 auto !important;
    margin-top: 36px !important;
    padding-top: 1.25rem !important;
  }
  
  /* Main sentence - allow text wrapping */
  .main-sentence,
  #mainSentenceContainer,
  #mainSentenceText {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    font-size: 1.15rem !important;
  }
  
  /* Word images group - allow wrapping */
  .word-images-group {
    white-space: normal !important;
    display: inline !important;
  }
  
  /* Word header - change layout to horizontal */
  .word-header > div:first-child {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0px !important;
    margin-bottom: 0 !important;
  }
  
  /* More specific selector for gap */
  .word-display-card .word-header > div:first-child {
    gap: 0px !important;
  }
  
  /* Even more specific with style attribute override */
  .word-display-card .word-header > div[style*="display: flex"] {
    gap: 0px !important;
  }
  
  /* Sound button - align to center */
  .word-header .sound-button {
    margin-top: 30px !important;
    flex-shrink: 0 !important;
  }
  
  /* Sound icon SVG - increase size */
  #soundIcon,
  svg#soundIcon,
  svg[id="soundIcon"],
  svg#soundIcon[width="35"] {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }
  
  /* Main sentence container - take remaining space */
  .word-header .main-sentence {
    flex: 1 !important;
    text-align: left !important;
  }
  
  /* Main sentence text - align left and limit width */
  #mainSentenceText {
    text-align: left !important;
    width: auto !important;
    display: inline !important;
    font-size: 1.15rem !important;
  }
  
  /* Highlighted word in main sentence - make it bigger */
  #mainSentenceText .highlighted-word,
  #mainSentenceText span[style*="color: rgb(28, 231, 131)"],
  #mainSentenceText span[style*="color: #1CE783"],
  #mainSentenceText span[style*="color:#1CE783"],
  #mainSentenceText span[style*="color:rgb(28, 231, 131)"] {
    font-size: 32px !important;
  }
  
  /* All spans inside main sentence - ensure font size */
  #mainSentenceText span,
  #mainSentenceContainer span,
  .main-sentence span {
    font-size: 1.15rem !important;
  }
  
  /* SVG images in main sentence - make them slightly bigger than sentence items */
  .main-sentence svg,
  #mainSentenceContainer svg,
  #mainSentenceText svg {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }
  
  /* Even smaller on phones */
  div[style*="justify-content: space-between"][style*="padding: 22px"],
  div[style*="justify-content: space-between"][style*="padding: 12px"] {
    padding: 10px 6px 6px 6px !important;
    font-size: 0.7rem !important;
  }
  
  #progressCurrent,
  #progressLevel,
  #progressMax {
    font-size: 0.7rem !important;
  }
  
  div[style*="position: relative; height: 50px"],
  div[style*="position: relative; height: 40px"] {
    height: 35px !important;
  }
  
  div[style*="height: 16px"][style*="background-color: rgba(68, 68, 68"],
  div[style*="height: 12px"][style*="background-color: rgba(68, 68, 68"] {
    height: 10px !important;
  }
}

/* ============================================ */
/* PROGRESS BAR MOBILE FIX */
/* ============================================ */

@media screen and (max-width: 480px) {
  /* Force progress bar to be visible and responsive */
  div[style*="display: flex"][style*="align-items: center"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  /* Any div that looks like progress container */
  div[style*="gap"][style*="align-items"] > div {
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }
  
  /* Text elements in progress area */
  div[style*="gap"][style*="align-items"] span,
  div[style*="gap"][style*="align-items"] div {
    font-size: 0.75rem !important;
    white-space: nowrap !important;
  }
  
  /* Progress bar itself */
  div[style*="background"][style*="border-radius"][style*="height"] {
    min-width: 80px !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }
}

@media screen and (max-width: 360px) {
  div[style*="gap"][style*="align-items"] span,
  div[style*="gap"][style*="align-items"] div {
    font-size: 0.7rem !important;
  }
  
  div[style*="background"][style*="border-radius"][style*="height"] {
    min-width: 60px !important;
  }
}


/* ============================================ */
/* MOBILE PROGRESS BAR FIX */
/* ============================================ */

@media screen and (max-width: 480px) {
  /* Ensure progress sections calculate width correctly on mobile */
  .progress-section {
    box-sizing: border-box !important;
  }
  
  /* Progress bar track should be full width */
  div[style*="background-color: rgba(68, 68, 68"] {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Progress sections - ensure they are clickable and above green bar */
  .progress-section {
    pointer-events: auto !important;
    z-index: 10 !important;
  }
  
  /* Green progress bar - remove min-width on mobile */
  #progressBar {
    min-width: 0 !important;
    pointer-events: none !important;
    z-index: 5 !important;
  }
}
