/* Flash Cards Styles - New design based on index.html */

/* Control Panel */
.control-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.controls-left {
  flex: 1;
  min-width: 300px;
}

.controls-right {
  display: flex;
  gap: 15px;
}

.control-item {
  margin-bottom: 15px;
}

.control-item label {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.control-item input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--bg-tertiary);
  border-radius: 5px;
  margin-right: 12px;
  position: relative;
  transition: all 0.3s;
  border: 2px solid var(--border-color);
}

.checkbox-custom:after {
  content: '';
  position: absolute;
  top: 2px;
  left: 7px;
  width: 7px;
  height: 14px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s;
}

.control-item input:checked+.checkbox-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-dark);
}

.control-item input:checked+.checkbox-custom:after {
  opacity: 1;
}

.hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-left: 36px;
  margin-top: 5px;
}

/* Language Toggle */
.language-toggle {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.toggle-label {
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-right: 15px;
  min-width: 130px;
}

.toggle-buttons {
  display: flex;
  gap: 10px;
  background-color: var(--bg-tertiary);
  padding: 5px;
  border-radius: 10px;
}

.toggle-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background-color: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.toggle-btn.active {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.5);
}

/* Progress */
.progress-container {
  margin-top: 20px;
}

.progress-label {
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.progress-bar {
  height: 10px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-color) 100%);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(37, 99, 235, 0.2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
      var(--primary-color),
      var(--info-color),
      var(--primary-dark));
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0.1));
  transform: skewX(-20deg);
  animation: shine 3s infinite;
}

@keyframes shine {

  0%,
  100% {
    left: -20px;
  }

  50% {
    left: calc(100% + 20px);
  }
}

/* Buttons */
button {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-2px);
}

.btn-secondary i {
  font-size: 0.9rem;
}

/* Flash Card */
.flashcard-container {
  margin-bottom: 40px;
}

.flashcard {
  perspective: 1000px;
  margin-bottom: 30px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 320px;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.flashcard-front {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.flashcard-back {
  background: linear-gradient(135deg, var(--success-color) 0%, var(--accent-color) 100%);
  color: white;
  transform: rotateY(180deg);
}

.language-label {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
}

.phrase {
  font-size: 1.8rem;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 15px;
  font-weight: 500;
}

.transcription {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
}

.phrase-example {
  font-size: 1rem;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  line-height: 1.4;
}

.hint-text {
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 20px;
  font-style: italic;
}

/* Audio Controls */
.audio-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}

.audio-btn {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  color: white;
}

.audio-btn:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
}

.audio-btn.playing {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* Navigation */
.navigation {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.nav-btn {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-color) 100%);
  color: var(--text-primary);
  padding: 15px 30px;
  font-size: 1.1rem;
  border: 1px solid var(--border-color);
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(31, 41, 55, 0.3);
}

.flip-btn {
  background: linear-gradient(135deg, var(--error-color) 0%, var(--warning-color) 100%);
}

/* Phrases List */
.phrases-list {
  background-color: var(--bg-secondary);
  border-radius: 15px;
  padding: 25px;
  margin-top: 30px;
  box-shadow: var(--shadow-md);
}

.phrases-list h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.phrases-list h3 i {
  color: var(--primary-color);
  margin-right: 10px;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.phrase-item {
  background-color: var(--bg-primary);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border-left: 5px solid var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phrase-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.phrase-item.active {
  border-left-color: var(--error-color);
  background-color: var(--bg-secondary);
}

.phrase-text {
  flex: 1;
}

.phrase-french {
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.phrase-english {
  font-size: 1rem;
  color: var(--text-secondary);
}

.phrase-number {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.phrase-item.active .phrase-number {
  background-color: var(--error-color);
  color: white;
}

/* Learning Tips */
.learning-tips {
  margin: 40px 0;
}

.category-header {
  text-align: center;
  margin-bottom: 40px;
}

.category-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.category-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}

.tip-card {
  background: var(--bg-primary);
  padding: 25px;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  text-align: center;
  border-top: 4px solid var(--primary-color);
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.tip-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.tip-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.tip-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Navigation CTA */
.nav-cta {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 40px;
  border-radius: 20px;
  margin: 40px 0;
  text-align: center;
}

.cta-content h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.cta-content p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.1rem;
}

.cta-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Instructions */
.instructions-card {
  background: var(--bg-secondary);
  padding: 25px;
  border-radius: 15px;
  margin-top: 40px;
  margin-bottom: 40px;
  border-left: 4px solid var(--primary-color);
}

.instructions-card h3 {
  color: var(--text-primary);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.instructions-card p {
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

/* Сворачиваемый список фраз */
.phrases-list {
  position: relative;
}

.phrases-list-toggle {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 5px;
  transition: all 0.3s;
}

.phrases-list-toggle:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.list-container {
  max-height: 400px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.list-container.collapsed {
  max-height: 0;
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .control-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .controls-right {
    width: 100%;
    justify-content: space-between;
  }

  .language-toggle {
    flex-direction: column;
    align-items: flex-start;
  }

  .toggle-label {
    margin-bottom: 10px;
  }

  .toggle-buttons {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
    justify-content: center;
  }

  .phrase {
    font-size: 1.5rem;
  }

  .flashcard-inner {
    height: 280px;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 30px;
  }

  .audio-controls {
    flex-direction: column;
    align-items: center;
  }

  .navigation {
    flex-direction: column;
  }

  .phrase-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .phrase-number {
    margin-bottom: 10px;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .phrases-list-toggle {
    position: static;
    margin-top: 10px;
    margin-left: auto;
    display: block;
  }
}

@media (max-width: 480px) {
  .phrase {
    font-size: 1.3rem;
  }

  .flashcard-inner {
    height: 250px;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 25px;
  }

  .language-label {
    font-size: 1rem;
  }

  .transcription {
    font-size: 1rem;
  }
}