* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f2f2f2;
  color: #111;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Language selector */
.lang-select {
  text-align: center;
  padding: 15px;
  background: #e5e5e5;
  flex-shrink: 0;
}

.lang-select button {
  margin: 5px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
}

/* Header */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
  flex-shrink: 0;
}

.side-img {
  width: 80px;
  border-radius: 12px;
}

.verse {
  font-size: 22px;
  text-align: center;
  font-weight: 600;
  color: #d4af37;
}

/* Language content */
.lang-content {
  display: none;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 20px auto;
  padding: 24px;
  background: #fff;
  border-radius: 14px;
  flex-grow: 1;
  height: auto;
  overflow: visible; /* Prevents vertical clipping */
}

.lang-content.active {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Provides consistent spacing between desc, links, and feedback */
}

/* Description text */
.desc {
  text-align: center;
  font-size: 20px;
  line-height: 1.9;
  margin: 0;
}

/* Links Container */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.links a {
  display: block;
  padding: 16px;
  background: #dcdcdc;
  border-radius: 12px;
  text-decoration: none;
  color: #111;
  font-size: 18px;
  transition: background 0.3s ease;
}

.links a:hover {
  background: #c8c8c8;
}

/* Feedback */
.feedback {
  display: block;
  margin-top: 10px; /* Standard spacing instead of auto push */
  text-align: center;
  padding: 14px;
  background: #d4af37;
  border-radius: 20px;
  color: #111;
  font-weight: 700;
  text-decoration: none;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.feedback:hover {
  background: #c09d2f;
}

/* RTL Specific Rules */
.rtl {
  direction: rtl;
  text-align: right;
}

.rtl .desc {
  text-align: right;
}

/* Language font assignments */
.fa {
  font-family: "Vazir", system-ui, sans-serif;
}

.ps {
  font-family: "BahijNaskh", system-ui, serif;
}

.en {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Responsive adjustments */
@media(max-width: 1024px) {
  .lang-content {
    max-width: 900px;
  }
}

@media(max-width: 600px) {
  .hero {
    flex-direction: column;
    padding: 15px;
  }

  .lang-content {
    padding: 16px;
    border-radius: 0;
    margin: 0;
  }

  .desc {
    font-size: 18px;
  }

  .links a {
    font-size: 17px;
    padding: 14px;
  }

  .feedback {
    font-size: 17px;
  }

  .lang-select {
    padding: 12px;
  }

  .lang-select button {
    font-size: 16px;
    padding: 6px 14px;
  }
}
