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

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Header */
header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #1976d2;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: #666;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #1976d2;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}

/* Dark Mode Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #1976d2;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider:hover {
  box-shadow: 0 0 1px #1976d2;
}

/* Visitor Counter */
.visitor-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  white-space: nowrap;
  padding: 5px 12px;
  background-color: #f5f5f5;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.visitor-counter:hover {
  background-color: #e8e8e8;
}

.visitor-icon {
  font-size: 16px;
}

.visitor-text {
  font-weight: 500;
}

#visitorCount {
  font-weight: 700;
  color: #1976d2;
}

/* Dark mode styles for visitor counter */
body.dark-mode .visitor-counter {
  background-color: #2a2a2a;
  color: #ccc;
}

body.dark-mode .visitor-counter:hover {
  background-color: #333;
}

body.dark-mode #visitorCount {
  color: #64b5f6;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  background-color: #fff;
  min-height: calc(100vh - 80px);
}

/* Search Section */
.search-section {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-section h1 {
  font-size: 36px;
  color: #1976d2;
  margin-bottom: 10px;
  font-weight: 600;
}

.search-section p {
  color: #666;
  margin-bottom: 20px;
  font-size: 15px;
}

.language-selector-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.type-in-label {
  font-size: 16px;
  color: #555;
  font-weight: normal;
}

.language-selector {
  display: flex;
  gap: 10px;
}

.language-box {
  flex: 1;
  max-width: 140px;
  padding: 8px 12px;
  background: #f0f0f0;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: normal;
  font-size: 14px;
  color: #666;
  transition: all 0.3s ease;
  user-select: none;
  white-space: nowrap;
  font-family: 'Noto Sans Ethiopic', sans-serif;
}

.language-box:hover {
  background: #e8e8e8;
  border-color: #999;
}

.language-box.active {
  background: #2196F3;
  border-color: #2196F3;
  color: white;
}

.typing-guide-link {
  font-size: 11px;
  color: #888;
  text-decoration: underline;
  margin-left: 8px;
  transition: color 0.2s;
}

.typing-guide-link:hover {
  color: #2196F3;
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#verbInput {
  font-family: 'Noto Sans Ethiopic', sans-serif !important;
  font-size: 18px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  width: 250px;
  transition: border-color 0.2s;
}

#verbInput:focus {
  outline: none;
  border-color: #1976d2;
}

.suggestions {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
  z-index: 5;
}

.suggestions-list {
  list-style: none;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  overflow: hidden;
}

.suggestions-list li {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.suggestions-list li:hover {
  background: #f5f8ff;
}

.suggestion-key {
  font-weight: 600;
  color: #1976d2;
}

.suggestion-en {
  font-size: 13px;
  color: #666;
}

button {
  font-size: 16px;
  padding: 12px 24px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

button:hover {
  background: #1565c0;
}

button:active {
  background: #0d47a1;
}

/* Output Section */
#output {
  margin-top: 30px;
}

#output .infinitive {
  margin-top: 6px;
  color: #555;
  font-size: 15px;
}

.inf-fidel {
  font-family: 'Noto Sans Ethiopic', sans-serif;
  color: #1976d2;
  font-weight: 600;
  margin-right: 6px;
}

.inf-translit {
  color: #666;
  font-style: italic;
}

#output h2 {
  font-size: 32px;
  color: #1976d2;
  margin-bottom: 8px;
  font-weight: 600;
}

#output h3 {
  font-size: 20px;
  color: #333;
  margin: 30px 0 15px 0;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 40px 0;
  background-color: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

th {
  background-color: #f5f5f5;
  color: #333;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}

tr:hover {
  background-color: #fafafa;
}

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

td:first-child {
  color: #666;
  font-weight: 500;
  width: 200px;
}

td:nth-child(2) {
  font-family: 'Noto Sans Ethiopic', sans-serif !important;
  font-size: 18px;
  color: #1976d2;
  font-weight: 500;
}

/* Apply Noto Sans Ethiopic to all Amharic text */
.inf-fidel,
.verb-fidel,
#output h2,
#output td:nth-child(2),
#output .fidel-text,
#verbInput,
.suggestion-key,
td:first-child,
.person-label {
  font-family: 'Noto Sans Ethiopic', sans-serif !important;
}

/* Match verb links styling */
.match-verb-link {
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: 'Noto Sans Ethiopic', sans-serif !important;
  background: #eef;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 4px;
}

.match-verb-link:hover {
  background-color: #d0e0ff !important;
  text-decoration: underline;
}

td:nth-child(3) {
  color: #666;
  font-style: italic;
}

td:last-child {
  color: #666;
  font-style: normal;
}

/* Common Verbs Section */
.common-verbs-section {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.common-verbs-section h2 {
  font-size: 28px;
  color: #1976d2;
  margin-bottom: 20px;
  font-weight: 600;
}

.common-verbs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.verb-box {
  background-color: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-family: 'Noto Sans Ethiopic', sans-serif;
}

.verb-box:hover {
  background-color: #e3f2fd;
  border-color: #1976d2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.verb-box .verb-fidel {
  font-size: 24px;
  color: #1976d2;
  font-weight: 600;
  margin-bottom: 5px;
}

.verb-box .verb-english {
  font-size: 14px;
  color: #666;
  font-style: normal;
}

/* Error Message */
.error {
  color: #d32f2f;
  padding: 15px;
  background-color: #ffebee;
  border-radius: 4px;
  margin-top: 20px;
  border-left: 4px solid #d32f2f;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }
  
  .search-section {
    padding: 20px;
  }
  
  .search-section h1 {
    font-size: 28px;
  }
  
  .search-section p {
    font-size: 14px;
  }
  
  .language-selector-wrapper {
    gap: 10px;
  }
  
  .type-in-label {
    font-size: 15px;
  }
  
  .language-selector {
    gap: 8px;
  }
  
  .language-box {
    padding: 8px 12px;
    font-size: 13px;
    max-width: 130px;
  }
  
  .typing-guide-link {
    font-size: 10px;
  }
  
  nav {
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .nav-links {
    gap: 15px;
    font-size: 14px;
  }
  
  .header-right {
    gap: 15px;
    width: 100%;
    justify-content: space-between;
  }
  
  .search-box {
    flex-direction: column;
    align-items: stretch;
  }
  
  #verbInput {
    width: 100%;
    font-size: 16px;
    padding: 14px;
  }
  
  button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }
  
  .suggestions {
    max-width: 100%;
  }
  
  table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  th, td {
    padding: 10px 8px;
    font-size: 13px;
    white-space: nowrap;
  }
  
  td:first-child {
    width: auto;
    min-width: 100px;
  }
  
  #output h2 {
    font-size: 24px;
  }
  
  #output h3 {
    font-size: 18px;
  }
  
  .common-verbs-section {
    padding: 20px;
  }
  
  .common-verbs-section h2 {
    font-size: 22px;
  }
  
  .common-verbs-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  
  .verb-box {
    padding: 12px 10px;
  }
  
  .verb-box .verb-fidel {
    font-size: 18px;
  }
  
  .verb-box .verb-english {
    font-size: 11px;
  }
  
  .toggle-label {
    font-size: 12px;
  }
  
  .switch {
    width: 45px;
    height: 22px;
  }
  
  .slider:before {
    height: 16px;
    width: 16px;
  }
  
  input:checked + .slider:before {
    transform: translateX(23px);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px 10px;
  }
  
  .search-section {
    padding: 15px;
  }
  
  .search-section h1 {
    font-size: 24px;
  }
  
  .language-selector-wrapper {
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .type-in-label {
    font-size: 14px;
  }
  
  .language-selector {
    gap: 6px;
  }
  
  .language-box {
    padding: 7px 10px;
    font-size: 12px;
    max-width: 120px;
  }
  
  .typing-guide-link {
    font-size: 9px;
    margin-left: 4px;
  }
  
  .logo {
    font-size: 18px;
  }
  
  nav {
    padding: 0 15px;
  }
  
  .header-right {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .nav-links {
    gap: 10px;
    font-size: 13px;
  }
  
  #verbInput {
    font-size: 16px;
    padding: 12px;
  }
  
  button {
    padding: 12px;
  }
  
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 8px 6px;
    font-size: 12px;
  }
  
  #output h2 {
    font-size: 20px;
  }
  
  #output h3 {
    font-size: 16px;
  }
  
  .common-verbs-section {
    padding: 15px;
  }
  
  .common-verbs-section h2 {
    font-size: 20px;
  }
  
  .common-verbs-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .verb-box {
    padding: 10px 8px;
  }
  
  .verb-box .verb-fidel {
    font-size: 16px;
  }
  
  .verb-box .verb-english {
    font-size: 10px;
  }
  
  .toggle-label {
    font-size: 11px;
  }
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode header {
  background-color: #1e1e1e;
  border-bottom-color: #333;
}

body.dark-mode .logo {
  color: #64b5f6;
}

body.dark-mode .nav-links a {
  color: #b0b0b0;
}

body.dark-mode .nav-links a:hover {
  color: #64b5f6;
}

body.dark-mode .toggle-label {
  color: #b0b0b0;
}

body.dark-mode .container {
  background-color: #121212;
}

body.dark-mode .search-section {
  background-color: #1e1e1e;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .search-section h1 {
  color: #64b5f6;
}

body.dark-mode .search-section p {
  color: #b0b0b0;
}

body.dark-mode #verbInput {
  background-color: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode #verbInput:focus {
  border-color: #64b5f6;
}

body.dark-mode button {
  background: #64b5f6;
  color: #121212;
}

body.dark-mode button:hover {
  background: #42a5f5;
  color: #121212;
}

body.dark-mode button:active {
  background: #1e88e5;
  color: #121212;
}

body.dark-mode .common-verbs-section {
  background-color: #1e1e1e;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .language-box {
  background: #2a2a2a;
  border-color: #444;
  color: #b0b0b0;
}

body.dark-mode .language-box:hover {
  background: #3a3a3a;
  border-color: #666;
}

body.dark-mode .language-box.active {
  background: #1976D2;
  border-color: #1976D2;
  color: white;
}

body.dark-mode .type-in-label {
  color: #b0b0b0;
}

body.dark-mode .typing-guide-link {
  color: #888;
}

body.dark-mode .typing-guide-link:hover {
  color: #64b5f6;
}

body.dark-mode .common-verbs-section h2 {
  color: #64b5f6;
}

body.dark-mode .verb-box {
  background-color: #2d2d2d;
  border-color: #444;
}

body.dark-mode .verb-box:hover {
  background-color: #1e3a5f;
  border-color: #64b5f6;
}

body.dark-mode .verb-box .verb-fidel {
  color: #64b5f6;
}

body.dark-mode .verb-box .verb-english {
  color: #b0b0b0;
}

body.dark-mode #output .infinitive {
  color: #b0b0b0;
}

body.dark-mode .inf-fidel {
  color: #64b5f6;
}

body.dark-mode .inf-translit {
  color: #b0b0b0;
}

body.dark-mode #output h2 {
  color: #64b5f6;
}

body.dark-mode #output h3 {
  color: #e0e0e0;
  border-bottom-color: #444;
}

body.dark-mode table {
  background-color: #1e1e1e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.dark-mode th {
  background-color: #2d2d2d;
  color: #e0e0e0;
  border-bottom-color: #444;
}

body.dark-mode td {
  border-bottom-color: #333;
  color: #e0e0e0;
}

body.dark-mode tr:hover {
  background-color: #2d2d2d;
}

body.dark-mode td:first-child {
  color: #b0b0b0;
}

body.dark-mode td:nth-child(2) {
  color: #64b5f6;
}

body.dark-mode td:nth-child(3) {
  color: #b0b0b0;
}

body.dark-mode td:last-child {
  color: #b0b0b0;
}

body.dark-mode .suggestions-list {
  background: #1e1e1e;
  border-color: #444;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

body.dark-mode .suggestions-list li:hover {
  background: #2d2d2d;
}

body.dark-mode .suggestion-key {
  color: #64b5f6;
}

body.dark-mode .suggestion-en {
  color: #b0b0b0;
}

body.dark-mode .match-verb-link {
  background-color: #2d2d2d !important;
  color: #64b5f6;
}

body.dark-mode .match-verb-link:hover {
  background-color: #1e3a5f !important;
  color: #90caf9;
}

/* Footer */
footer {
  background-color: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 20px 0;
  margin-top: 40px;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

/* Footer Attribution */
.footer-attribution {
  text-align: center;
  max-width: 900px;
}

.footer-attribution p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.footer-link {
  color: #1976d2;
  text-decoration: underline;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* Visitor Counter in Footer */
footer .visitor-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #666;
  white-space: nowrap;
  padding: 10px 20px;
  background-color: #f5f5f5;
  border-radius: 25px;
  transition: background-color 0.2s;
}

footer .visitor-counter:hover {
  background-color: #e8e8e8;
}

footer .visitor-icon {
  font-size: 18px;
}

footer .visitor-text {
  font-weight: 500;
}

footer #visitorCount {
  font-weight: 700;
  color: #1976d2;
  font-size: 18px;
}

/* Dark mode styles for footer */
body.dark-mode footer {
  background-color: #1a1a1a;
  border-top-color: #333;
}

body.dark-mode footer .visitor-counter {
  background-color: #2a2a2a;
  color: #ccc;
}

body.dark-mode footer .visitor-counter:hover {
  background-color: #333;
}

body.dark-mode footer #visitorCount {
  color: #64b5f6;
}

body.dark-mode .footer-attribution p {
  color: #aaa;
}

body.dark-mode .footer-link {
  color: #64b5f6;
}

body.dark-mode .footer-link:hover {
  color: #90caf9;
}