/* topic.css - Стили для темы разговорника */

/* Основные стили страницы */
.colloquial-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Введение */
.colloquial-intro {
  margin-bottom: 60px;
}

.colloquial-intro .intro-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.colloquial-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-weight: 600;
}

.feature-text p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

/* Категории */
.colloquial-categories {
  margin-bottom: 60px;
}

.colloquial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.colloquial-category-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.colloquial-category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.category-icon {
  font-size: 32px;
  margin-bottom: 15px;
  display: inline-block;
}

.colloquial-category-card h3 {
  margin: 0 0 10px 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.colloquial-category-card>p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: var(--bg-light);
  border-left: 3px solid transparent;
}

.category-link:hover {
  background: var(--primary-color-light);
  color: var(--primary-color-dark);
  border-left-color: var(--primary-color);
  transform: translateX(3px);
}

/* Примеры */
.real-life-examples {
  margin-bottom: 60px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.example-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.example-header {
  display: flex;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
}

.example-label {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.example-label.informal {
  background: var(--primary-color-light);
  color: var(--primary-color-dark);
}

.example-content {
  padding: 20px;
}

.formal-example,
.informal-example {
  margin-bottom: 15px;
}

.formal-example:last-child,
.informal-example:last-child {
  margin-bottom: 0;
}

.formal-example p,
.informal-example p {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-style: italic;
  color: var(--text-primary);
}

.formal-example p {
  color: var(--text-secondary);
}

.informal-example p {
  color: var(--primary-color-dark);
  font-weight: 500;
}

.example-translation {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  font-style: normal;
  padding-left: 15px;
  border-left: 2px solid var(--border-color);
  margin-top: 5px;
}

.informal-example .example-translation {
  border-left-color: var(--primary-color);
}

/* Советы по изучению */
.learning-tips {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  border-radius: var(--radius-xl);
  margin: 2rem -1rem 4rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.tip-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tip-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tip-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tip-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* CTA Section Enhancements */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  color: white !important;
  padding: 4rem 0;
  text-align: center;
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.cta-section h2 {
  color: white !important;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.cta-actions .btn {
  margin: 0 0.5rem;
}

/* ===== Стили для страниц разговорных выражений ===== */

/* Контейнер выражений */
.expressions-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Сетка выражений */
.expressions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-top: 30px;
}

/* Карточка выражения */
.expression-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.expression-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

/* Заголовок карточки */
.expression-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--bg-light);
}

.expression-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Мета-информация выражения */
.expression-meta {
  display: flex;
  gap: 10px;
}

.expression-type {
  background: var(--primary-color-light);
  color: var(--primary-color-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.expression-type.british {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.expression-type.american {
  background: var(--bg-secondary);
  color: var(--error-color);
}

/* Контент выражения */
.expression-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.english-expression,
.russian-expression {
  padding: 15px;
  background: var(--bg-light);
  border-radius: 8px;
  position: relative;
}

.expression-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.expression-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.transcription {
  font-style: italic;
  color: var(--text-primary);
}

.topic-link {
  display: block;
  padding: 12px 15px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.topic-link:hover {
  background: var(--primary-color-light);
  border-color: var(--primary-color);
  color: var(--primary-color-dark);
  transform: translateX(5px);
}

.topic-link.current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 600;
}

/* Category Header */
.category-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.category-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ===== Стили для TTS кнопок ===== */

.tts-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 10;
}

.tts-btn:hover:not(:disabled) {
  background: var(--primary-color-dark);
  transform: scale(1.1);
}

.tts-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.tts-btn.playing {
  background: var(--error-color);
  animation: pulse 1.5s infinite;
}

.tts-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

/* Уведомления TTS */
.tts-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  max-width: 300px;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
}

.tts-notification-error {
  background: var(--bg-secondary);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

.tts-notification-info {
  background: var(--bg-secondary);
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Состояния кнопок во время воспроизведения */
.tts-btn.playing {
  background: linear-gradient(135deg, var(--error-color), color-mix(in srgb, var(--error-color) 80%, black));
  color: white;
}

.tts-btn.loading {
  background: var(--warning-color);
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .colloquial-content {
    padding: 0 15px;
  }

  .colloquial-grid,
  .examples-grid,
  .tips-grid {
    grid-template-columns: 1fr;
  }

  .colloquial-features {
    grid-template-columns: 1fr;
  }

  .category-header h2 {
    font-size: 1.75rem;
  }

  .learning-tips {
    padding: 2rem 1rem;
    margin: 2rem -0.5rem 3rem;
  }

  .tips-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tip-card {
    padding: 1.5rem;
  }

  .cta-section {
    padding: 30px 20px;
    margin: 40px 0;
  }

  .cta-content h2 {
    font-size: 24px;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
    text-align: center;
  }

  .expression-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .expression-header {
    flex-direction: column;
    gap: 10px;
  }

  .expression-meta {
    align-self: flex-start;
  }

  .tts-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .colloquial-intro .intro-content {
    padding: 20px;
  }

  .colloquial-category-card {
    padding: 20px;
  }

  .example-content {
    padding: 15px;
  }

  .tip-card {
    padding: 20px;
  }

  .category-header p {
    font-size: 1rem;
  }

  .feature-item {
    flex-direction: column;
    text-align: center;
  }

  .learning-tips {
    padding: 1.5rem 0.5rem;
  }

  .expressions-container {
    padding: 0 15px;
  }

  .expression-card {
    padding: 20px;
  }

  .expression-type {
    font-size: 11px;
    padding: 3px 10px;
  }

  .tts-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
    top: 10px;
    right: 10px;
  }
}

/* Анимация появления элементов */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Задержки для последовательного появления */
.colloquial-category-card:nth-child(1) {
  animation-delay: 0.1s;
}

.colloquial-category-card:nth-child(2) {
  animation-delay: 0.2s;
}

.colloquial-category-card:nth-child(3) {
  animation-delay: 0.3s;
}

.colloquial-category-card:nth-child(4) {
  animation-delay: 0.4s;
}

.colloquial-category-card:nth-child(5) {
  animation-delay: 0.5s;
}

.colloquial-category-card:nth-child(6) {
  animation-delay: 0.6s;
}

.colloquial-category-card:nth-child(7) {
  animation-delay: 0.7s;
}

.example-card:nth-child(1) {
  animation-delay: 0.2s;
}

.example-card:nth-child(2) {
  animation-delay: 0.3s;
}

.example-card:nth-child(3) {
  animation-delay: 0.4s;
}

.tip-card:nth-child(1) {
  animation-delay: 0.1s;
}

.tip-card:nth-child(2) {
  animation-delay: 0.2s;
}

.tip-card:nth-child(3) {
  animation-delay: 0.3s;
}

.tip-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Эффекты для активных элементов */
.category-link:focus,
.colloquial-category-card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Медиа-запросы для анимаций */
@media (prefers-reduced-motion: reduce) {

  .colloquial-category-card,
  .example-card,
  .tip-card {
    animation: none !important;
    transition: none !important;
  }
}

/* Стили для состояний загрузки */
.colloquial-category-card.loading {
  position: relative;
  overflow: hidden;
}

.colloquial-category-card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Анимация для новых карточек */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.expression-card {
  animation: slideIn 0.4s ease forwards;
  animation-delay: calc(var(--card-index, 0) * 0.1s);
}