/* Egyedi stílusok, 3D kártyaeffektusok, mobil optimalizáció és animációk */

/* Mobil érintés (touch) optimalizálás: megszünteti a 300ms-os késleltetést és a dupla koppintásos nagyítást */
html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Mobilon (iOS Safari) a 16px-nél kisebb betűméretű inputok automatikus oldal-zoomot váltanak ki. Ezt megakadályozzuk: */
@media (max-width: 640px) {
  input[type="text"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Gombok és kártyák touch-action */
button,
.flip-card,
.nav-tab-btn,
.quiz-option-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* 3D Kártya forgatás beállításai */
.perspective-1000 {
  perspective: 1000px;
}

.flip-card {
  background-color: transparent;
  width: 100%;
  height: 300px;
  cursor: pointer;
}

@media (min-width: 640px) {
  .flip-card {
    height: 340px;
  }
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 1.5rem;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  user-select: none;
}

.flip-card-front {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
}

.flip-card-back {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: white;
  transform: rotateY(180deg);
  border: 2px solid #4338ca;
}

/* Pulzáló animáció a kiejtés jelzésére */
@keyframes cardPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  }
  100% {
    transform: scale(1);
  }
}

.card-pulse {
  animation: cardPulse 0.3s ease-in-out;
}

/* Rázkódás effekt helytelen válasznál */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Egyedi görgetősáv a szép listákhoz */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Finom gomb-aktív állapotok érintésre */
.active-scale:active {
  transform: scale(0.97);
}

/* Modál megjelenési animáció */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-in {
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

