.language-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-xxl);
}

.language-card {
  background: var(--card);
  padding: var(--space-2xl);
  border-radius: var(--border-radius);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* Remove blue highlight */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  outline: none;
  -webkit-focus-ring-color: transparent;
}

.language-card:hover:not(.soon) {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
  transform: scale(1.02);
  transition: transform 0.15s ease;
}

.language-card.soon {
  opacity: 0.6;
}

.language-icon {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: var(--space-lg);
  line-height: 1;
}

.language-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.language-card p {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  opacity: 0.8;
}

.status {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 20px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: auto;
}

.status {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status.soon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.table-wrapper {
  overflow: auto;
  max-height: 70vh;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

thead {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 600;
  z-index: 10;
}

th {
  padding: var(--space-lg) var(--space-md);
  font-size: var(--font-size-base);
  text-align: center;
}

td {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

tr:nth-child(even) {
  background: var(--bg);
}
.dark tr:nth-child(even) {
  background: var(--bg-dark);
}

tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.dark tr:hover {
  background: rgba(99, 102, 241, 0.1);
}

.row-highlight {
  border-top: 4px solid var(--secondary);
}

.script-char {
  font-size: 2.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.latin-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.conjuncts-table td:first-child {
  font-size: 1.8rem;
  font-weight: 500;
}

section {
  margin-bottom: var(--space-3xl);
}

section h3 {
  padding-top: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-md);
  font-weight: 600;
  color: var(--text);
}

section > p {
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
  font-size: var(--font-size-md);
}

.nav-buttons {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  z-index: 1000;
}

.nav-buttons {
  padding-bottom: env(safe-area-inset-bottom);
  padding-right: env(safe-area-inset-right);
}

.nav-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--card);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-button.scale-down {
  transform: scale(0.9);
}

#home-button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
}

#theme-toggle {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
}

.language-card[data-lang="kannada"] .language-icon {
  transform: translateY(8px);
}
.language-card[data-lang="malayalam"] .language-icon {
  transform: translateY(2px);
}

/* Custom scrollbar styling */
.table-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* For Firefox */
.table-wrapper {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-secondary);
}

/* Dark theme adjustments */
.dark .table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-secondary-dark);
}

.dark .table-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary);
}

.dark .table-wrapper {
  scrollbar-color: var(--primary) var(--bg-secondary-dark);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  background-color: var(--bg);
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

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

.spinner {
  border: 16px solid var(--primary);
  border-top: 16px solid var(--secondary);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: spin 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) infinite;

  filter: blur(0.8px);
  box-shadow: 0 0 10px var(--secondary), 0 0 20px var(--secondary), 0 0 40px var(--secondary),
    inset 0 0 20px var(--primary);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dark .spinner {
  border: 16px solid var(--primary-dark);
  border-top: 22px solid var(--secondary);
}

@media (max-width: 768px) {
  .nav-button {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .nav-buttons {
    bottom: var(--space-md);
    right: var(--space-md);
  }
}

@media (max-width: 480px) {
  .nav-button {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .nav-buttons {
    bottom: var(--space-lg);
    right: var(--space-sm);
  }
}
