/* ========== BODY - BACKGROUND ========== */
body {
  background-color: #130617;
  background-image: 
    linear-gradient(135deg, rgba(19, 6, 23, 0.8) 0%, rgba(26, 6, 37, 0.8) 50%, rgba(37, 5, 43, 0.8) 75%, rgba(42, 6, 44, 0.8) 100%),
    url('../../img/coverBlockhero.png');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  background-blend-mode: normal, normal;
  color: #ffffff;
  padding-top: 80px;
  min-height: 100vh;
}

/* Стили основаны на реальном проекте Visual Dictionary */
:root {
  --vd-bg: #fcf7ee;
  --vd-primary: #1195ad;
  --vd-accent: #f0763e;
  --vd-text: #333;
  --vd-border: #e8e3db;
}

.visual-dict-demo {
  max-width: 100%;
  margin: 0;
  padding: 40px 24px 80px;
  min-height: calc(100vh - 80px);
  display: flex;
  justify-content: center;
  font-family: "Arial", sans-serif;
}

.demo-content-wrapper {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  background-color: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #620080; /* Фиолетовый цвет по умолчанию для всего текста на белом фоне */
}

.demo-header {
  text-align: center;
  padding: 30px 24px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(98, 0, 128, 0.15) 100%);
  border-radius: 20px;
  margin-bottom: 30px;
}

.back-link {
  display: inline-block;
  color: #620080;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 15px;
  transition: color 0.3s;
}

.back-link:hover {
  color: #9333ea;
}

.demo-header h1 {
  font-size: 2.2rem;
  color: #620080;
  margin-bottom: 8px;
  font-weight: 700;
}

.demo-subtitle {
  font-size: 1rem;
  color: #620080;
  opacity: 0.9;
  font-weight: 500;
}

/* Информационный блок */
.demo-info-box {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(98, 0, 128, 0.2) 100%);
  border: 2px solid rgba(147, 51, 234, 0.3);
  border-radius: 20px;
  padding: 24px;
  margin: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-content h3 {
  font-size: 1.1rem;
  color: #620080;
  margin-bottom: 10px;
  font-weight: 700;
}

.info-content p {
  color: #620080;
  line-height: 1.6;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.info-note {
  background: rgba(98, 0, 128, 0.15);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid rgba(147, 51, 234, 0.5);
  margin-top: 10px;
}

.info-note strong {
  color: #620080;
}

/* Демо секции */
.demo-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.demo-section.hidden {
  display: none;
}

.demo-section h2 {
  font-size: 1.8rem;
  color: #620080;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 700;
}

.section-description {
  text-align: center;
  color: #620080;
  opacity: 0.9;
  margin-bottom: 24px;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
}

/* Видео контейнер */
.video-container {
  max-width: 1000px;
  margin: 40px auto;
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.demo-video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Главное меню */
.menu-container {
  background: var(--vd-bg);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 4px 12px var(--vd-border);
  text-align: center;
}

.menu-container h2 {
  font-size: 2.5rem;
  color: var(--vd-accent);
  margin-bottom: 32px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.menu-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  background: var(--vd-primary);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(17, 149, 173, 0.3);
  font-family: "Arial", sans-serif;
}

.menu-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(17, 149, 173, 0.4);
  background: var(--vd-accent);
}

.menu-btn .icon {
  font-size: 3rem;
}

.menu-btn .text {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Категории - стили из оригинального проекта */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  background: var(--vd-bg);
  border-radius: 20px;
  box-shadow: 0 4px 12px var(--vd-border);
  padding: 36px 32px;
  max-width: 900px;
  margin: 0 auto 24px;
}

.category-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--vd-primary);
}

.category-card .icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1.5rem;
  color: var(--vd-text);
  margin: 0;
  font-weight: bold;
}

/* Слова - стили из оригинального проекта */
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  background: var(--vd-bg);
  border-radius: 20px;
  box-shadow: 0 4px 12px var(--vd-border);
  padding: 36px 32px;
  max-width: 900px;
  margin: 0 auto 24px;
}

.word-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
}

.word-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--vd-primary);
}

.word-card-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--vd-text);
  margin-bottom: 10px;
}

.word-card-translate {
  font-size: 1.2rem;
  color: #555;
  direction: rtl;
  text-align: right;
}

/* Интерактивный словарь - точная копия оригинального стиля */
.clickable-visual-dictionary {
  text-align: center;
  font-family: Arial, sans-serif;
  background: var(--vd-bg);
  border-radius: 20px;
  box-shadow: 0 4px 12px var(--vd-border);
  padding: 36px 32px 32px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.clickable-visual-dictionary h1 {
  padding: 10px;
  margin-bottom: 40px;
  font-size: 2rem;
  color: var(--vd-text);
}

.clickable-visual-dictionary .content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}

.clickable-visual-dictionary .image-container {
  position: relative;
  display: inline-block;
  width: 70%;
  max-width: 700px;
  height: auto;
  margin: 0 auto;
}

.clickable-visual-dictionary .image-container img {
  max-width: 100%;
  border-radius: 8px;
  height: auto;
  display: block;
  object-fit: contain;
}

.clickable-visual-dictionary .image-container .shape {
  position: absolute;
  border: 2px solid transparent;
  background-color: transparent;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s;
}

.clickable-visual-dictionary .image-container .shape:hover,
.clickable-visual-dictionary .image-container .shape.highlighted {
  border-color: red;
  background-color: rgba(255, 0, 0, 0.1);
}

.clickable-visual-dictionary .shape-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 30%;
  min-width: 300px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: var(--vd-primary);
}

.clickable-visual-dictionary .shape-item {
  width: calc(50% - 5px);
  padding: 8px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  background-color: #fff;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s;
  font-size: 0.9rem;
  color: var(--vd-text);
}

.clickable-visual-dictionary .shape-item:hover,
.clickable-visual-dictionary .shape-item.highlighted {
  border-color: red;
  background-color: rgba(255, 255, 255, 0.9);
}

.clickable-visual-dictionary .shape-item .fa-volume-high {
  color: var(--vd-primary);
  font-size: 1rem;
}

/* Поиск */
.search-container {
  background: var(--vd-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px var(--vd-border);
  max-width: 900px;
  margin: 0 auto;
}

#searchInput {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1rem;
  border: 2px solid var(--vd-border);
  border-radius: 12px;
  margin-bottom: 24px;
  font-family: "Arial", sans-serif;
  transition: border-color 0.3s;
}

#searchInput:focus {
  outline: none;
  border-color: var(--vd-primary);
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--vd-text);
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

/* Кнопки навигации */
.back-menu-btn,
.back-btn {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--vd-primary);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Arial", sans-serif;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 24px;
}

.back-menu-btn:hover,
.back-btn:hover {
  background: var(--vd-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 149, 173, 0.3);
}

/* Адаптивность */
@media (max-width: 1100px) {
  .clickable-visual-dictionary .image-container {
    width: 100%;
  }
  
  .clickable-visual-dictionary .shape-list {
    width: 100%;
    min-width: auto;
    max-width: 700px;
  }
  
  .clickable-visual-dictionary .shape-item {
    width: calc((100% / 3) - 7px);
  }
}

@media (max-width: 768px) {
  .demo-section {
    padding: 16px;
  }

  .menu-buttons {
    grid-template-columns: 1fr;
  }

  .categories-grid,
  .words-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px 20px;
  }

  .search-results {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .clickable-visual-dictionary .shape-item {
    width: calc(50% - 5px);
  }
}

@media (max-width: 540px) {
  .clickable-visual-dictionary .shape-item {
    width: calc(50% - 5px);
  }
  
  .categories-grid,
  .words-grid {
    grid-template-columns: 1fr;
  }
}
