body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  padding-top: 70px; /* Reduced space for the header */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 0;
}

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 4px 20px; /* Reduced vertical padding */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px; /* Reduced height */
}

/* Logo styles */
.logo-container {
  justify-self: start;
  display: flex;
  align-items: center;
  padding-left: 4px; /* Small adjustment for visual balance */
}

.logo {
  height: 28px; /* Slightly smaller logo */
  width: auto;
  max-height: 32px; /* Reduced maximum height */
}


.app-header #searchInput {
  min-width: 250px; /* Fixed width instead of 100% */
  padding: 6px 12px; /* Slightly smaller padding */
  border: 1px solid #ddd;
  border-radius: 6px; /* Less rounded corners */
  font-size: 14px; /* Slightly smaller font */
  transition: border-color 0.3s, box-shadow 0.3s;
  max-width: 100%; /* Ensure it's responsive */
}

.app-header #searchInput:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

h1 {
  color: #2c3e50;
  margin: 0;
  flex: 1;
  min-width: 200px;
  text-align: center;
  margin-bottom: 20px;
}

.introduction {
  background-color: #f8faff;
  border-left: 4px solid #4a90e2;
  padding: 15px 20px;
  margin: 0 0 25px 0;
  border-radius: 0 4px 4px 0;
}

.introduction p {
  margin: 0 0 10px 0;
  color: #2c3e50;
  line-height: 1.6;
}

.introduction p:last-child {
  margin-bottom: 0;
}

.contribution-note {
  margin-top: 15px !important;
  padding-top: 10px;
  border-top: 1px solid #e0e8f0;
  font-size: 0.95em;
  color: #4a5568;
}

.contribution-note a {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
}

.contribution-note a:hover {
  text-decoration: underline;
}

/* Search container in main content (hidden) */
.search-container {
  display: none;
}

/* Header search container (visible) */
.app-header .search-container {
  display: block !important; /* Override any other rules */
  width: 100%;
  max-width: 500px; /* Adjust based on your preference */
  margin: 0 auto;
  grid-column: 2; /* Place in the center column */
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #f2f8ff;
  font-weight: 600;
  color: #2c3e50;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

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

.pronunciation {
  font-style: italic;
  color: #7f8c8d;
  font-size: 0.9em;
}

.play-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  background-color: #f8f9fa;
}

.play-btn:hover {
  background-color: #e9ecef;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.play-btn svg {
  width: 20px;
  height: 20px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  gap: 8px;
  align-items: center;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dee2e6;
  background: white;
  color: #3498db;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: #f1f8ff;
  border-color: #3498db;
  transform: translateY(-1px);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8f9fa;
}

.pagination .page-info {
  margin: 0 12px;
  font-size: 14px;
  color: #6c757d;
  min-width: 100px;
  text-align: center;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.pagination button.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.no-results {
  text-align: center;
  padding: 30px;
  color: #7f8c8d;
  font-style: italic;
}

.term {
  font-weight: 600;
  color: #2c3e50;
}

.definition {
  margin-top: 5px;
  color: #34495e;
}

.status-message {
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
}

/* Install Button */
.install-button {
  justify-self: end;
  margin-left: auto;
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.install-button:hover {
  background-color: #357abd;
}

.install-button:active {
  transform: translateY(1px);
}

.install-button__text {
  font-weight: 500;
}

/* PWA specific styles */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .container {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Status bar color for iOS */
@supports (-webkit-touch-callout: none) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

footer {
  text-align: center;
  margin-top: 20px;
  color: #6c757d;
}