* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f7fa;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Loading Indicator */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.loading-subtext {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.sidebar-header:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-header:active {
  background: rgba(255,255,255,0.08);
}

.sidebar-header h2 {
  color: #fff;
  margin: 0;
  font-size: 1.25rem;
  transition: color 0.3s ease;
}

.sidebar-header:hover h2 {
  color: #667eea;
}

.sidebar-header span {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  transition: color 0.3s ease;
}

.sidebar-header:hover span {
  color: rgba(255,255,255,0.7);
}

.nav-links {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-links li a svg {
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-links li a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-links li a:hover svg {
  opacity: 1;
}

.nav-links li a.active {
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  border-left-color: #667eea;
}

.nav-links li a.active svg {
  opacity: 1;
}

/* Sidebar Footer - Buy Me a Coffee */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.coffee-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #FFDD00 0%, #FBB034 100%);
  color: #1a1a2e;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
}

.coffee-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.5);
  background: linear-gradient(135deg, #FBB034 0%, #FFDD00 100%);
}

.coffee-button svg {
  flex-shrink: 0;
}

.coffee-button span {
  white-space: nowrap;
}

/* Suggestion Box Button */
.suggestion-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #FFFFFF;
  color: #1a1a2e;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 235, 59, 0.5);
}

.suggestion-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 235, 59, 0.5);
  background: linear-gradient(135deg, #FFFFFF 0%, #FFEB3B 100%);
}

.suggestion-button svg {
  flex-shrink: 0;
}

.suggestion-button span {
  white-space: nowrap;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  animation: menuGlow 2s ease-in-out 0.5s 2;
}

/* Glow animation for hamburger menu on page load */
@keyframes menuGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  25% {
    box-shadow: 0 0 20px rgba(74, 105, 189, 0.6), 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 25px rgba(74, 105, 189, 0.8), 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  75% {
    box-shadow: 0 0 20px rgba(74, 105, 189, 0.6), 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a2e;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.menu-toggle:active {
  transform: translateY(0);
}

/* Move button when sidebar is open and animate to X */
.menu-toggle.open {
  left: 270px;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Back Button */
.back-button {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 150;
  background: rgba(102, 126, 234, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
}

.back-button:hover {
  background: rgba(102, 126, 234, 1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.back-button:active {
  transform: translateY(0);
}

/* Main Content */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* Pages */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Container */
.container {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.container.wide {
  max-width: 800px;
}

h1 {
  margin: 0 0 0.25rem 0;
  color: #333;
  font-size: 1.75rem;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: #666;
  margin: 0 0 1.5rem 0;
  font-size: 0.9rem;
}

/* Search */
.search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  font-size: 1.2rem;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #667eea;
}

input::placeholder {
  color: #aaa;
}

.keyboard-toggle {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #667eea;
  padding: 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.keyboard-toggle:hover {
  background: #f0f0ff;
}

.keyboard-toggle.active {
  background: #667eea;
  color: white;
}

/* Greek Keyboard */
.greek-keyboard {
  display: none;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.2s ease;
}

.greek-keyboard.active {
  display: block;
}

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

.keyboard-row {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
  justify-content: center;
}

.keyboard-row:last-child {
  margin-bottom: 0;
}

.key {
  min-width: 40px;
  height: 40px;
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #333;
}

.key:hover {
  background: #e8e8e8;
  border-color: #667eea;
  transform: translateY(-1px);
}

.key:active {
  transform: translateY(0);
  background: #d8d8d8;
}

.key-accent {
  background: #f0f8ff;
  border-color: #4DD0E1;
  color: #0277BD;
}

.key-accent:hover {
  background: #e0f2ff;
}

.key-backspace {
  background: #ffe8e8;
  border-color: #ffb8b8;
  min-width: 50px;
  font-size: 1.2rem;
  color: #c62828;
}

.key-backspace:hover {
  background: #ffd8d8;
}

#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
  overflow: hidden;
}

.suggestion {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 1rem;
}

.suggestion:hover {
  background: #f5f5ff;
}

.suggestion:last-child {
  border-bottom: none;
}

.suggestion-conjugated {
  background: #f0f8ff;
  border-left: 3px solid #4DD0E1;
}

.suggestion-conjugated:hover {
  background: #e6f4ff;
}

/* Verb Header */
.verb-header {
  text-align: center;
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.verb-header h2 {
  color: #667eea;
  margin: 0;
  font-size: 1.75rem;
}

.verb-header .meaning {
  display: block;
  color: #888;
  font-size: 1rem;
  font-style: italic;
  margin-top: 0.25rem;
}

.verb-header .voice-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.75rem;
  text-transform: uppercase;
}

.verb-header .voice-badge.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.verb-header .voice-badge.passive {
  background: #fff3e0;
  color: #e65100;
}

/* Conjugation Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

caption {
  color: #000;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  background: #667eea; /* Default fallback */
  text-shadow: none;
}

/* Soft Pastel Color Palette */
.tense-present caption {
  background: #C8E6C9; /* Sage */
}

.tense-simple-future caption {
  background: #81D4FA; /* Sky */
}

.tense-aorist caption {
  background: #FFAB91; /* Coral */
}

.tense-continuous-future caption {
  background: #FFCDD2; /* Rose */
}

.tense-continuous-past caption {
  background: #80CBC4; /* Mint */
}

.tense-imperative caption {
  background: #E6EE9C; /* Lime */
}

.tense-subjunctive caption {
  background: #4DD0E1; /* Aqua */
}

.tense-participle caption {
  background: #FFF59D; /* Lemon */
}

.tense-perfect caption {
  background: #FFCC80; /* Peach */
}

.tense-past-subjunctive caption {
  background: #9FA8DA; /* Cornflower */
}

.tense-infinitive caption {
  background: #CE93D8; /* Lavender */
}

.tense-past-perfect caption {
  background: #F48FB1; /* Orchid */
}

.tense-perfect-subjunctive caption {
  background: #D7CCC8; /* Sand */
}

.tense-future-perfect caption {
  background: #B0BEC5; /* Slate */
}

td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e8e8e8;
}

tr:last-child td {
  border-bottom: none;
}

td:first-child {
  color: #666;
  width: 40%;
}

td:last-child {
  font-weight: 500;
  color: #333;
}

/* Combined Imperative Table */
.imperative-header {
  font-weight: 600;
  color: #333;
  text-align: center;
  background: #f8f9fa;
  font-size: 0.85rem;
  border-bottom: 2px solid #e0e0e0;
}

table.tense-imperative td:nth-child(2),
table.tense-imperative td:nth-child(3) {
  width: 30%;
  font-weight: 500;
}

/* Special Form Tables (Participle, Infinitive) */
table.special-form {
  background: #fafafa;
}

table.special-form td {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  padding: 1rem;
}

/* Hide 3rd person imperative forms by default */
tr.imperative-third-person {
  display: none;
}

/* Toggle Tenses Button */
.toggle-tenses-btn {
  width: 100%;
  padding: 1rem;
  margin: 1.5rem 0;
  background: white;
  color: #1e3799;
  border: 2px solid #f39c12;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.15);
}

.toggle-tenses-btn:hover {
  background: #fffbf5;
  border-color: #e67e22;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25);
}

.toggle-tenses-btn:active {
  transform: translateY(0);
  background: #fff8ed;
}

.toggle-tenses-btn .btn-icon {
  transition: transform 0.3s ease;
}

.toggle-tenses-btn.expanded .btn-icon {
  transform: rotate(180deg);
}

/* Additional Tenses Container */
.tenses-container.additional-tenses {
  animation: fadeIn 0.3s ease;
}

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

.not-found {
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Clear Button Section */
.clear-section {
  text-align: center;
  margin: 1rem 0 1.5rem 0;
}

.clear-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.clear-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.clear-button:active {
  transform: translateY(0);
}

.clear-button svg {
  flex-shrink: 0;
}

/* Irregular Verbs Section */
.irregular-verbs-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #f0f0f0;
}

.irregular-verbs-title {
  text-align: center;
  color: #444;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
}

.irregular-verbs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
}

.irregular-verb-btn {
  background: white;
  color: #333;
  border: 1.5px solid #d0d0d0;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.irregular-verb-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.25);
}

.irregular-verb-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* Show clear button when result is shown */
#result:not(:empty) ~ .irregular-verbs-section {
  display: none;
}

/* Mobile adjustments for clear button */
@media (max-width: 768px) {
  .clear-button {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
  }
}

/* Alphabetical List */
.letter-section {
  margin-bottom: 2rem;
  scroll-margin-top: 5rem;
}

.letter-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.verb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.verb-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.verb-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

.verb-card .verb-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.verb-card .verb-meaning {
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}

/* Alphabet Index for Mobile Navigation */
.alphabet-index {
  display: none;
  position: fixed;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 0.25rem 0.15rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none;
  flex-direction: column;
}

.alphabet-index::-webkit-scrollbar {
  display: none;
}

.alphabet-index-letter {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #667eea;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  border-radius: 4px;
  user-select: none;
  min-width: 20px;
}

.alphabet-index-letter:hover {
  background: #667eea;
  color: white;
  transform: scale(1.15);
}

.alphabet-index-letter:active,
.alphabet-index-letter.active {
  background: #764ba2;
  color: white;
  transform: scale(1.25);
}

/* Essential Verbs */
.essential-intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
}

.essential-intro h3 {
  margin: 0 0 0.5rem 0;
}

.essential-intro p {
  margin: 0;
  opacity: 0.9;
}

.essential-category {
  margin-bottom: 2rem;
}

.category-header {
  background: #f8f9fa;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  color: #444;
  margin-bottom: 1rem;
  border-left: 4px solid #667eea;
}

.essential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.essential-card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.essential-card:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.essential-card {
  border-left: 3px solid #28a745;
}

.essential-card .rank {
  background: #f0f0f0;
  color: #666;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.essential-card .verb-info {
  flex: 1;
}

.essential-card .verb-name {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.essential-card .verb-meaning {
  color: #888;
  font-size: 0.75rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }
  
  .container {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  input {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
  }
  
  .verb-grid,
  .essential-grid {
    grid-template-columns: 1fr;
  }
  
  .back-button {
    top: 1rem;
    right: 1rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  
  .sidebar-footer {
    bottom: 60px;
  }
  
  /* Hide Greek keyboard on mobile (native keyboards have Greek support) */
  .keyboard-toggle,
  .greek-keyboard {
    display: none !important;
  }
  
  /* Irregular verbs on mobile */
  .irregular-verbs-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  
  .irregular-verbs-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .irregular-verb-btn {
    font-size: 0.95rem;
    padding: 0.5rem 0.85rem;
  }
}

/* Overlay for mobile menu */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
}

.overlay.active {
  display: block;
}

/* Hide alphabet index on desktop */
@media (min-width: 769px) {
  .alphabet-index {
    display: none !important;
  }
}

/* ========== FLASHCARDS ========== */
.flashcard-container {
  max-width: 600px;
}

.flashcard-options {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 26px;
  transition: background 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked + .toggle-switch {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(24px);
}

.toggle-text {
  font-weight: 500;
  color: #333;
  font-size: 0.95rem;
}

.flashcard-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-correct {
  color: #28a745;
}

.stat-wrong {
  color: #dc3545;
}

.stat-remaining {
  color: #667eea;
}

.flashcard-carousel {
  perspective: 1000px;
  margin-bottom: 1.5rem;
  min-height: 350px;
  position: relative;
  overflow: hidden;
}

.flashcard-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.flashcard {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 350px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform: translateX(100%) scale(0.9) rotate(5deg);
}

.flashcard.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

.flashcard.active.slide-in {
  transform: translateX(0) scale(1) rotate(0deg);
}

.flashcard.swipe-right {
  animation: swipeRight 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.flashcard.swipe-left {
  animation: swipeLeft 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes swipeRight {
  0% {
    transform: translateX(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(120%) scale(0.8) rotate(15deg);
    opacity: 0;
  }
}

@keyframes swipeLeft {
  0% {
    transform: translateX(0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-120%) scale(0.8) rotate(-15deg);
    opacity: 0;
  }
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

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

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  border: 2px solid #e8e8e8;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.card-number {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.flashcard-back .card-number {
  color: rgba(255, 255, 255, 0.7);
}

.card-view-conjugation {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #1a1a2e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-view-conjugation:hover {
  background: #FFEB3B;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.flashcard-back .card-view-conjugation {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.flashcard-back .card-view-conjugation:hover {
  background: rgba(255, 235, 59, 0.9);
  color: #1a1a2e;
}

.card-verb {
  font-size: 3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
  text-align: center;
}

.card-hint {
  font-size: 1rem;
  color: #888;
  font-style: italic;
}

.card-meaning {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}

.card-verb-small {
  font-size: 1.5rem;
  opacity: 0.9;
  text-align: center;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

.fc-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.fc-btn:active {
  transform: translateY(0);
}

.fc-btn-wrong {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.fc-btn-wrong:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.fc-btn-flip {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

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

.fc-btn-correct {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
}

.fc-btn-correct:hover {
  background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
}

.flashcard-progress {
  width: 100%;
  height: 8px;
  background: #e8e8e8;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.5s ease;
  border-radius: 8px;
}

.fc-restart {
  width: 100%;
  padding: 1rem;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.fc-restart:hover {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.fc-restart:active {
  transform: translateY(0);
}

/* Completion Card */
.completion-card {
  position: relative !important;
  opacity: 1 !important;
  transform: translateX(0) scale(1) !important;
  height: 400px;
  margin-bottom: 1rem;
}

.completion-card .flashcard-inner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.completion-content {
  text-align: center;
  color: white;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.completion-top {
  flex: 0 0 auto;
  color: #000;
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.completion-middle {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.completion-bottom {
  flex: 0 0 auto;
}

.completion-emoji {
  font-size: 3rem;
  margin-bottom: 0.4rem;
  animation: bounce 1s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

.completion-content h2 {
  font-size: 1.75rem;
  margin: 0 0 0.4rem 0;
  color: #000;
}

.completion-score {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: #000;
}

.completion-percentage {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 0;
  color: #000;
}

.completion-encouragement {
  font-size: 1.05rem;
  color: #000;
  opacity: 1;
  margin: 0.5rem 0 1rem 0;
  font-style: italic;
  max-width: 90%;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.completion-retry,
.completion-restart {
  background: white;
  color: #667eea;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  margin: 0.4rem 0;
}

.completion-retry {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
}

.completion-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

.completion-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.completion-retry:active,
.completion-restart:active {
  transform: translateY(0);
}

/* Mobile Flashcard Adjustments */
@media (max-width: 768px) {
  .flashcard {
    height: 300px;
  }
  
  .card-verb {
    font-size: 2.2rem;
  }
  
  .card-meaning {
    font-size: 1.75rem;
  }
  
  .card-verb-small {
    font-size: 1.25rem;
  }
  
  .flashcard-stats {
    gap: 1rem;
    font-size: 1rem;
  }
  
  .flashcard-options {
    margin-bottom: 1rem;
  }
  
  .toggle-text {
    font-size: 0.85rem;
  }
  
  .fc-btn-wrong,
  .fc-btn-correct {
    width: 50px;
    height: 50px;
  }
  
  .fc-btn-flip {
    width: 60px;
    height: 60px;
  }
  
  .completion-card {
    height: 350px;
    margin-bottom: 0.5rem;
  }
  
  .completion-emoji {
    font-size: 2.5rem;
  }
  
  .completion-content {
    padding: 1rem;
  }
  
  .completion-top {
    padding: 0.75rem;
    margin-bottom: 0.4rem;
  }
  
  .completion-content h2 {
    font-size: 1.5rem;
  }
  
  .completion-score {
    font-size: 1.75rem;
  }
  
  .completion-percentage {
    font-size: 0.85rem;
  }
  
  .completion-encouragement {
    font-size: 0.95rem;
    margin: 0.4rem 0 0.8rem 0;
    padding: 0.4rem 0.8rem;
  }
  
  .completion-retry,
  .completion-restart {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
    min-width: 160px;
  }
}
