:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.dark-theme {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #475569;
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --danger-color: #f87171;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title i {
  color: var(--accent-color);
  font-size: 2.25rem;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
  font-size: 1.25rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.search-section {
  margin-bottom: 2rem;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.125rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.125rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.clear-search.visible {
  opacity: 1;
  visibility: visible;
}

.clear-search:hover {
  color: var(--danger-color);
  background: var(--bg-tertiary);
}

.search-stats {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.search-stats span {
  color: var(--accent-color);
  font-weight: 600;
}

.verbs-section {
  flex: 1;
  margin-bottom: 2rem;
}

.table-container {
  background: var(--bg-secondary);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.verbs-table {
  width: 100%;
  border-collapse: collapse;
}

.table-header {
  background: var(--bg-tertiary);
  padding: 1.25rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-header i {
  margin-right: 0.5rem;
  color: var(--accent-color);
}

.verbs-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.verbs-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.verbs-table tbody tr:last-child {
  border-bottom: none;
}

.verbs-table td {
  padding: 1rem;
  vertical-align: middle;
}

.verb-cell {
  font-weight: 500;
  color: var(--text-primary);
}

.verb-infinitive {
  color: var(--accent-color);
  font-weight: 600;
}

.verb-past {
  color: var(--warning-color);
  font-weight: 500;
}

.verb-participle {
  color: var(--success-color);
  font-weight: 500;
}

.verb-translation {
  color: var(--text-secondary);
  font-style: italic;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.no-results-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.no-results p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 400px;
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: auto;
}

.footer i {
  color: var(--danger-color);
  margin: 0 0.25rem;
}

@media (max-width: 1024px) {
  .container {
    padding: 0 1rem;
  }
  
  .title {
    font-size: 2.25rem;
  }
  
  .search-container {
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .title i {
    font-size: 1.75rem;
  }
  
  .header-content {
    justify-content: space-between;
    align-items: center;
  }
  
  .header {
    padding: 1.5rem 0;
  }
  
  .table-container {
    border-radius: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .verbs-table {
    min-width: 600px;
  }
  
  .table-header,
  .verbs-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .table-header {
    font-size: 0.75rem;
  }
  
  .search-input {
    font-size: 1rem;
    padding: 0.875rem 0.875rem 0.875rem 2.75rem;
  }
  
  .search-icon {
    left: 0.875rem;
    font-size: 1rem;
  }
  
  .clear-search {
    right: 0.875rem;
  }
  
  .theme-toggle {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.125rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .title {
    font-size: 1.875rem;
    order: 1;
  }
  
  .theme-toggle {
    order: 2;
    align-self: center;
  }
  
  .search-container {
    max-width: 100%;
  }
  
  .search-input {
    padding: 1rem 3rem 1rem 2.5rem;
    font-size: 1rem;
  }
  
  .search-icon {
    left: 0.75rem;
  }
  
  .clear-search {
    right: 0.75rem;
  }
  
  .verbs-table {
    min-width: 550px;
  }
  
  .table-header {
    font-size: 0.7rem;
    padding: 0.75rem 0.4rem;
  }
  
  .verbs-table td {
    padding: 0.75rem 0.4rem;
    font-size: 0.9rem;
  }
  
  .no-results {
    padding: 3rem 1rem;
  }
  
  .footer {
    padding: 1.5rem 0;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .title {
    font-size: 1.625rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .title i {
    font-size: 1.5rem;
  }
  
  .header {
    padding: 1.25rem 0;
  }
  
  .search-section {
    margin-bottom: 1.5rem;
  }
  
  .search-input {
    padding: 0.875rem 2.75rem 0.875rem 2.25rem;
    font-size: 0.95rem;
    border-radius: 0.625rem;
  }
  
  .search-icon {
    left: 0.625rem;
    font-size: 0.95rem;
  }
  
  .clear-search {
    right: 0.625rem;
  }
  
  .table-container {
    border-radius: 0.625rem;
    margin: 0 -0.5rem;
  }
  
  .verbs-table {
    min-width: 480px;
  }
  
  .table-header {
    padding: 0.625rem 0.3rem;
    font-size: 0.65rem;
  }
  
  .table-header i {
    display: none;
  }
  
  .verbs-table td {
    padding: 0.625rem 0.3rem;
    font-size: 0.85rem;
  }
  
  .verb-translation {
    font-size: 0.8rem;
  }
  
  .theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .no-results {
    padding: 2.5rem 1rem;
  }
  
  .no-results-icon {
    font-size: 3rem;
  }
  
  .no-results h3 {
    font-size: 1.25rem;
  }
  
  .no-results p {
    font-size: 0.9rem;
  }
}

@media (max-width: 450px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }
  
  .title {
    font-size: 1.5rem;
    flex-direction: row;
    gap: 0.5rem;
    flex: 1;
  }
  
  .title i {
    font-size: 1.375rem;
  }
  
  .theme-toggle {
    order: 2;
    align-self: center;
    flex-shrink: 0;
  }
  
  .verbs-table th:nth-child(4),
  .verbs-table td:nth-child(4) {
    display: none;
  }
  
  .verbs-table {
    min-width: 350px;
  }
  
  .table-header,
  .verbs-table td {
    padding: 0.625rem 0.4rem;
  }
}

@media (max-width: 375px) {
  .container {
    padding: 0 0.375rem;
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .title i {
    font-size: 1.375rem;
  }
  
  .search-input {
    padding: 0.75rem 2.5rem 0.75rem 2rem;
    font-size: 0.9rem;
  }
  
  .search-icon {
    left: 0.5rem;
    font-size: 0.9rem;
  }
  
  .clear-search {
    right: 0.5rem;
  }
  
  .table-container {
    margin: 0 -0.375rem;
  }
  
  .verbs-table {
    min-width: 450px;
  }
  
  .table-header {
    padding: 0.5rem 0.25rem;
    font-size: 0.6rem;
  }
  
  .verbs-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .verb-translation {
    font-size: 0.75rem;
  }
  
  .search-stats {
    font-size: 0.8rem;
  }
  
  .theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .theme-toggle,
  .clear-search {
    min-height: 44px;
    min-width: 44px;
  }
  
  .search-input {
    min-height: 44px;
  }
  
  .verbs-table tbody tr {
    min-height: 44px;
  }
  
  .table-container {
    scroll-behavior: smooth;
  }
  
  .table-container::-webkit-scrollbar {
    height: 4px;
  }
  
  .table-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .header {
    padding: 1rem 0;
  }
  
  .search-section {
    margin-bottom: 1rem;
  }
  
  .title {
    font-size: 1.75rem;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.mobile-device .search-input {
  font-size: 16px !important;
}

.mobile-device .table-container {
  cursor: grab;
}

.mobile-device .table-container:active {
  cursor: grabbing;
}

.mobile-device .theme-toggle,
.mobile-device .clear-search {
  min-height: 48px;
  min-width: 48px;
}

.mobile-device .verbs-table tbody tr:hover {
  background: var(--bg-tertiary);
  transform: scale(1.01);
  transition: all 0.2s ease;
}

.mobile-device .search-input:focus {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.highlight {
  background-color: var(--accent-color);
  color: var(--bg-primary);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
}