:root {
  --bg-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --card-bg: rgba(255, 255, 255, 0.92);
  --primary: #ff6f61;
  --secondary: #4f5d75;
  --accent: #26c485;
  --info: #5185ec;
  --danger: #f45b69;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  --radius: 28px;
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Baloo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #2d2d2d;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
}

.top-bar .logo {
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emoji {
  font-size: 2.5rem;
}

.current-profile-pill,
.badge {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-size: 1.1rem;
  color: #fff;
}

.badge {
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  margin-right: 0.5rem;
}

.badge.info {
  background: var(--info);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.app-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}

.card h1,
.card h2 {
  margin-top: 0;
  font-size: 2.4rem;
}

.subtitle {
  margin: 0.5rem 0 2rem;
  font-size: 1.3rem;
  color: var(--secondary);
}

.profile-form label {
  font-size: 1.2rem;
  color: var(--secondary);
}

.input-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.input-row input {
  flex: 1;
  padding: 1rem 1.2rem;
  font-size: 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: var(--transition);
}

.input-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.menu-button {
  border: none;
  border-radius: var(--radius);
  font-size: 1.4rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  font-weight: 600;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 111, 97, 0.5);
}

.primary-btn:hover {
  transform: translateY(-3px);
}

.secondary-btn {
  background: var(--info);
  color: #fff;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  text-decoration: none;
}

.top-bar .back-btn {
  text-decoration: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 0.8rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

.top-bar .back-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.menu-button {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.8);
  padding: 1.5rem;
  border-radius: var(--radius);
  font-size: 1.5rem;
  box-shadow: 0 15px 25px rgba(79, 93, 117, 0.1);
}

.menu-button span {
  font-size: 1.8rem;
  color: var(--primary);
}

.menu-button small {
  font-size: 1.1rem;
  color: var(--secondary);
}

.menu-button:hover {
  transform: translateY(-5px);
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.profile-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  font-size: 1.5rem;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
  position: relative;
  padding-right: 3.5rem; /* hely a törlés gombnak */
}

.profile-card:hover,
.profile-card.active {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.delete-profile-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 8px 16px rgba(244, 91, 105, 0.4);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 30px;
  z-index: 2;
}

.profile-form .primary-btn {
  margin-top: 0.75rem;
}

.profile-card strong,
.profile-card small {
  display: block;
}

.question-card {
  grid-column: 1 / -1;
}

.answers-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
}

.answer-button {
  font-size: 2.2rem;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 4px solid transparent;
  border-radius: var(--radius);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: var(--transition);
}

.answer-button:hover {
  transform: translateY(-4px);
}

.answer-button.correct {
  border-color: var(--accent);
  background: #e3f9ef;
}

.answer-button.wrong {
  border-color: var(--danger);
  background: #ffe3e8;
}

.answers-grid.disabled .answer-button {
  pointer-events: none;
  opacity: 0.6;
}

.practice-actions,
.assessment-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.big {
  font-size: 1.6rem;
  padding: 1.2rem 2.5rem;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: center;
}

.stat {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat .label {
  display: block;
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.stat strong {
  font-size: 2.5rem;
}

.recent-answers {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.3rem;
}

.recent-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
}

.recent-dot.correct {
  background: var(--accent);
}

.recent-dot.wrong {
  background: var(--danger);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hidden {
  display: none !important;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  padding: 1rem;
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
}

.checkbox-tile input {
  transform: scale(1.5);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 1.4rem;
}

.toggle input {
  display: none;
}

.slider {
  width: 70px;
  height: 36px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50px;
  position: relative;
  transition: var(--transition);
}

.slider::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::after {
  transform: translateX(34px);
}

.settings-form button {
  align-self: flex-start;
}

.mentor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mentor-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  border: 3px solid transparent;
  border-radius: var(--radius);
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.mentor-tile img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin: 0.25rem auto 0.5rem;
}

.mentor-tile span {
  display: block;
  font-size: 1.1rem;
  color: var(--secondary);
}

.mentor-tile input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mentor-tile.selected {
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(255, 111, 97, 0.25);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
}

.dog-mentor {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 180px;
  transition: transform 0.4s ease;
}

.dog-mentor.happy {
  animation: jump 1s ease forwards;
}

.dog-mentor.encourage {
  animation: wiggle 0.8s ease;
}

@keyframes jump {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes wiggle {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 999px;
  font-size: 1.3rem;
  box-shadow: var(--shadow);
}

@media (max-width: 1024px) {
  .top-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .app-container {
    width: 95%;
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .dog-mentor {
    display: none;
  }
}

