* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button:focus,
button:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

::selection {
  background: rgba(255, 230, 109, 0.3);
  color: inherit;
}

:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --accent-color: #ffe66d;
  --bg-gradient-1: #667eea;
  --bg-gradient-2: #764ba2;
  --text-dark: #2d3436;
  --text-light: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.25);
  --border-radius: 20px;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-1) 0%,
    var(--bg-gradient-2) 100%
  );
  min-height: 100vh;
  height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 15px;
  overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-1) 0%,
    var(--bg-gradient-2) 100%
  );
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.welcome-screen.active {
  display: flex;
}

.welcome-content {
  text-align: center;
  color: var(--text-light);
  animation: fadeInDown 0.6s ease-out;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-content h1 {
  font-size: 3rem;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-description {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px 30px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  margin-bottom: 40px;
}

.welcome-description p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin: 8px 0;
  line-height: 1.5;
}

.welcome-description .highlight {
  color: var(--accent-color);
  font-size: 1.3rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-start {
  background: linear-gradient(135deg, var(--accent-color) 0%, #ffd93d 100%);
  color: var(--text-dark);
  font-size: 1.3rem;
  padding: 18px 50px;
  box-shadow: 0 6px 30px rgba(255, 230, 109, 0.5);
}

.btn-start:hover {
  background: linear-gradient(135deg, #ffe97d 0%, #ffe34d 100%);
  box-shadow: 0 8px 35px rgba(255, 230, 109, 0.7);
}

/* App Store Buttons */
.app-store-buttons {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  justify-content: center;
  align-items: center;
}

.store-button {
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.95;
}

.store-button:hover {
  transform: translateY(-3px);
  opacity: 1;
}

.store-badge {
  height: 50px;
  width: auto;
  display: block;
}

.app-store .store-badge {
  height: 50px;
}

.google-play .store-badge {
  height: 60px;
}

/* Hide app store buttons on mobile devices */
@media (max-width: 768px) {
  .app-store-buttons {
    display: none;
  }
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.view.active {
  display: flex;
  animation: fadeIn 0.4s ease-out;
}

/* Flashcard */
.flashcard {
  background: white;
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease-out;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.word-number {
  text-align: right;
  color: #95a5a6;
  font-size: 0.75rem;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e9ecef;
}

.spanish-word {
  font-size: 1.6rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 12px;
  font-weight: bold;
}

.translation-section {
  text-align: center;
  margin: 12px 0;
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(78, 205, 196, 0.1),
    rgba(255, 107, 107, 0.1)
  );
  border-radius: 12px;
}

.polish-translation {
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 6px;
  font-weight: bold;
}

.description {
  font-size: 0.9rem;
  color: #636e72;
  font-style: italic;
}

.examples-section {
  margin-top: 12px;
  flex: 1;
  overflow-y: auto;
}

.examples-section h4 {
  color: var(--text-dark);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.example {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--secondary-color);
}

.example-spanish {
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.example-polish {
  color: #636e72;
  font-size: 0.85rem;
}

/* Actions */
.actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 8px;
}

.navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: scale(0.95);
}

.btn-remember {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
  color: white;
  min-width: 160px;
  animation: pulse 2s ease-in-out infinite;
}

.btn-remember:hover {
  background: linear-gradient(135deg, #a5b5b6 0%, #8f9c9d 100%);
  animation: none;
}

.btn-remember.memorized {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  animation: none;
  box-shadow: 0 4px 20px rgba(56, 239, 125, 0.4);
}

.btn-remember.memorized:hover {
  background: linear-gradient(135deg, #21a89e 0%, #48ff8d 100%);
  box-shadow: 0 6px 25px rgba(56, 239, 125, 0.6);
}

.btn-nav {
  background: linear-gradient(135deg, var(--primary-color) 0%, #ee5a6f 100%);
  color: white;
}

.btn-nav:hover {
  background: linear-gradient(135deg, #ff7b7b 0%, #fe6a7f 100%);
}

.btn-previous {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-previous:hover {
  background: linear-gradient(135deg, #768efa 0%, #865bb2 100%);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 4px 25px rgba(127, 140, 141, 0.4);
  }
}

.btn-secondary {
  background: #636e72;
  color: white;
}

.btn-secondary:hover {
  background: #737e82;
}

.btn-quiz {
  background: linear-gradient(135deg, var(--accent-color) 0%, #ffd93d 100%);
  color: var(--text-dark);
  width: 100%;
}

.btn-quiz:hover {
  background: linear-gradient(135deg, #ffe97d 0%, #ffe34d 100%);
  box-shadow: 0 6px 25px rgba(255, 230, 109, 0.4);
}

.btn-quiz.disabled {
  background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
  color: #7f8c8d;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-quiz.disabled:hover {
  background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
  box-shadow: none;
  transform: none;
}

.btn-quiz.quiz-active {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
}

.btn-quiz.quiz-active:hover {
  background: linear-gradient(135deg, #ff7b7b 0%, #fe6a7f 100%);
  box-shadow: 0 6px 25px rgba(255, 107, 107, 0.4);
}

/* Quiz */
.quiz-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px 25px;
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease-out;
}

.quiz-header {
  text-align: center;
  margin-bottom: 30px;
}

.quiz-header h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 10px;
}

.quiz-score {
  font-size: 1.2rem;
  color: var(--secondary-color);
  font-weight: bold;
}

.quiz-card {
  margin-bottom: 30px;
}

.quiz-question {
  font-size: 1.4rem;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(
    135deg,
    rgba(78, 205, 196, 0.1),
    rgba(255, 107, 107, 0.1)
  );
  border-radius: 15px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.quiz-option {
  padding: 15px;
  background: #f8f9fa;
  border: 3px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.quiz-option:hover {
  background: #e9ecef;
  border-color: var(--secondary-color);
}

.quiz-option:focus {
  outline: none;
}

.quiz-option:active {
  background: #dee2e6;
}

.quiz-option.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.quiz-option.incorrect {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.quiz-option.disabled:hover,
.quiz-option.correct:hover,
.quiz-option.incorrect:hover {
  background: inherit;
  border-color: inherit;
}

.quiz-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.quiz-result {
  text-align: center;
  padding: 30px;
}

.quiz-result h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.quiz-result p {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 30px;
}

/* Footer */
.app-footer {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 12px;
  padding-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  margin-top: 10px;
  margin-bottom: 8px;
}

.progress-section {
  margin-bottom: 12px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--text-dark);
  font-size: 0.85rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--secondary-color) 0%,
    var(--primary-color) 100%
  );
  border-radius: 10px;
  transition: width 0.5s ease;
  width: 0%;
}

.footer-actions {
  display: flex;
  gap: 10px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .app-container {
    padding: 10px;
  }

  .welcome-content h1 {
    font-size: 2.5rem;
  }

  .welcome-description {
    padding: 15px 20px;
  }

  .welcome-description p {
    font-size: 1rem;
  }

  .welcome-description .highlight {
    font-size: 1.2rem;
  }

  .btn-start {
    font-size: 1.2rem;
    padding: 16px 40px;
  }

  .spanish-word {
    font-size: 1.4rem;
  }

  .flashcard {
    padding: 12px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .btn-remember {
    min-width: 140px;
  }

  .quiz-question {
    font-size: 1.2rem;
    padding: 12px;
    margin-bottom: 15px;
  }

  .quiz-option {
    font-size: 0.9rem;
    padding: 12px;
  }

  .quiz-options {
    max-height: 350px;
  }

  .app-footer {
    padding-bottom: 18px;
    margin-bottom: 10px;
  }
}

@media (max-width: 390px) {
  .welcome-content h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
  }

  .welcome-description {
    padding: 12px 18px;
    margin-bottom: 30px;
  }

  .welcome-description p {
    font-size: 0.95rem;
  }

  .welcome-description .highlight {
    font-size: 1.1rem;
  }

  .btn-start {
    font-size: 1.1rem;
    padding: 15px 35px;
  }

  .spanish-word {
    font-size: 1.3rem;
  }

  .polish-translation {
    font-size: 1.1rem;
  }

  .app-footer {
    padding: 10px;
    padding-bottom: 20px;
    margin-bottom: 12px;
  }

  .quiz-question {
    font-size: 1.1rem;
    padding: 10px;
    margin-bottom: 12px;
  }

  .quiz-option {
    font-size: 0.85rem;
    padding: 10px;
  }

  .quiz-options {
    max-height: 300px;
    gap: 10px;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
  .quiz-option:hover {
    background: #f8f9fa;
    border-color: transparent;
  }

  .btn:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .btn-quiz:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffd93d 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .btn-quiz.quiz-active:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
}
