* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f5f7fa;
  min-height: 100vh;
  display: flex;
}

/* 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;
}

.sidebar-header h2 {
  color: #fff;
  margin: 0;
  font-size: 1.25rem;
}

.sidebar-header span {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}

.nav-links {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

.nav-links li a {
  display: block;
  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:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-links li a.active {
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  border-left-color: #667eea;
}

/* 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;
}

.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);
}

/* 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 {
  width: 100%;
  font-size: 1.2rem;
  padding: 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;
}

#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;
}

/* 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;
}

/* Conjugation Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

caption {
  color: white;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: #667eea; /* Default fallback */
}

/* Tense-specific colors */
.tense-present caption {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.tense-simple-future caption {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tense-aorist caption {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.tense-continuous-future caption {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tense-imperfect caption {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

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;
}

.not-found {
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Alphabetical List */
.letter-section {
  margin-bottom: 2rem;
}

.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;
}

/* 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.available {
  border-left: 3px solid #28a745;
}

.essential-card.unavailable {
  border-left: 3px solid #dc3545;
  opacity: 0.7;
}

.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;
}

.legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #666;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.available {
  background: #28a745;
}

.legend-dot.unavailable {
  background: #dc3545;
}

/* 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;
  }
}

/* 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;
}
