/* ── PRACTICA PAGE STYLES ── */

.practice-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.practice-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.block-selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.block-selection-header h3 {
  margin-bottom: 0;
  text-align: left;
}

.block-selection-header .btn-reset {
  padding: 0.6rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.block-selection-header .btn-reset:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* ── BLOCKS GRID ── */
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.block-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.block-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.block-card.completed {
  background: var(--solved-bg);
  border-color: var(--solved);
}

.block-card.completed::before {
  content: '✓';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: var(--solved);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.block-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.block-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.block-count {
  font-size: 0.9rem;
  color: var(--text2);
}

.block-card.completed .block-count {
  color: var(--solved);
}

.block-progress-bar {
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.block-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.block-progress-text {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.block-card.completed .block-progress-text {
  color: var(--solved);
}

/* ── PRACTICE HEADER ── */
.practice-header {
  margin-bottom: 2rem;
}

.practice-header h3 {
  text-align: left;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text2);
  font-weight: 600;
}

/* ── CONTENT CARD ── */
.content-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.content-question {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2rem;
  font-family: 'Outfit', sans-serif;
}

.content-instruction {
  font-size: 0.9rem;
  color: var(--text3);
  line-height: 1.5;
  margin-top: 1rem;
  max-width: 800px;
  background: var(--bg2);
  padding: 1rem;
  border-radius: 10px;
  text-align: left;
}

.content-instruction strong {
  color: var(--primary);
}

.content-description {
  font-size: 0.92rem;
  color: var(--text2);
  line-height: 1.6;
  margin: 0 auto 2.5rem;
  max-width: 700px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.content-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-mastered,
.btn-review {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-mastered {
  background: var(--solved-bg);
  color: var(--solved);
  border: 2px solid var(--solved);
}

.btn-mastered:hover {
  background: var(--solved);
  color: #fff;
  transform: translateY(-2px);
}

.btn-review {
  background: var(--bg2);
  color: var(--primary);
  border: 2px solid var(--border2);
}

.btn-review:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ── EXERCISE PANEL ── */
.exercise-panel {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-md);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.exercise-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text3);
  transition: color 0.2s;
}

.btn-close:hover {
  color: var(--text);
}

.exercise-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg2);
  border-radius: 8px;
}

/* ── SOLUTION SECTION ── */
.solution-section {
  margin: 1.5rem 0;
}

.btn-solution-toggle {
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text2);
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-solution-toggle:hover {
  background: var(--border2);
  color: var(--primary);
}

.btn-solution-toggle.open {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.solution-body {
  display: none;
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  line-height: 1.7;
}

.solution-body.open {
  display: block;
}

/* ── AI RESOLVER SECTION ── */
.ai-resolver-section {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg2);
  border-radius: 8px;
  text-align: center;
}

.no-solution-text {
  font-size: 0.95rem;
  color: var(--text2);
  margin-bottom: 1rem;
}

.ai-resolver-container {
  position: relative;
  display: inline-block;
}

.btn-ai {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ai:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-2px);
}

.ai-options-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  min-width: 180px;
  overflow: hidden;
}

.ai-options-dropdown.open {
  display: flex;
  flex-direction: column;
}

.ai-option-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-option-btn:hover {
  background: var(--bg2);
}

.ai-option-icon {
  font-size: 1.2rem;
}

/* ── EXERCISE ACTIONS ── */
.exercise-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-new-exercise,
.btn-finished {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-new-exercise {
  background: var(--bg2);
  color: var(--text2);
}

.btn-new-exercise:hover {
  background: var(--border2);
  color: var(--primary);
}

.btn-finished {
  background: var(--solved-bg);
  color: var(--solved);
  border: 2px solid var(--solved);
}

.btn-finished:hover {
  background: var(--solved);
  color: #fff;
}

/* ── COMPLETED CARD ── */
.completed-card {
  background: var(--card);
  border: 2px solid var(--solved);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.completed-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.completed-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--solved);
  margin-bottom: 1rem;
}

.completed-card p {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 2rem;
}

.btn-next,
.btn-back-home {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin: 0.5rem;
}

.btn-next {
  background: var(--accent);
  color: #fff;
}

.btn-next:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-back-home {
  background: var(--bg2);
  color: var(--text2);
}

.btn-back-home:hover {
  background: var(--border2);
  color: var(--primary);
}

/* ── BACK BUTTON ── */
.btn-back {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-back:hover {
  color: var(--accent);
}

/* ── SPINNER ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .practice-section {
    padding: 1rem;
  }

  .blocks-grid {
    grid-template-columns: 1fr;
  }

  .content-actions {
    flex-direction: column;
  }

  .btn-mastered,
  .btn-review {
    width: 100%;
  }

  .exercise-actions {
    flex-direction: column;
  }

  .btn-new-exercise,
  .btn-finished {
    width: 100%;
  }

  .completed-card {
    padding: 2rem 1rem;
  }

  .completed-icon {
    font-size: 4rem;
  }

  .completed-card h3 {
    font-size: 1.5rem;
  }
}