:root {
  --red: #ed1c24;
  --red-dark: #bb1117;
  --ink: #15151b;
  --muted: #6e7280;
  --bg: #f7f4f1;
  --card: #ffffff;
  --line: #ece5df;
  --shadow: 0 20px 60px rgba(22, 21, 27, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(237, 28, 36, 0.10), transparent 28rem),
    linear-gradient(180deg, #fff 0%, var(--bg) 45%, #fff 100%);
}

[dir="rtl"] body {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(237, 28, 36, 0.97), rgba(134, 14, 20, 0.97)),
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.35), transparent 18rem);
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -5% -90px -5%;
  height: 180px;
  background: #fff;
  border-radius: 50% 50% 0 0;
  opacity: 0.96;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  height: 78px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
  flex: 0 0 auto;
}

.brand img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-actions,
.language-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.12);
}

.nav-actions a,
.lang-btn {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
}

.nav-actions a:hover,
.lang-btn:hover,
.lang-btn.active {
  background: rgba(255, 255, 255, 0.18);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 430px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 44px;
  padding: 34px 0 126px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 950;
  color: var(--red);
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 30px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.93;
  letter-spacing: -0.07em;
}

[dir="rtl"] h1,
[dir="rtl"] h2 {
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.05em;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn,
.small-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
}

.btn:hover,
.small-btn:hover,
.swap-btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.20);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.time-card {
  justify-self: end;
  width: min(100%, 330px);
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px);
}

.time-card span,
.time-card small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

.time-card strong {
  display: block;
  margin: 10px 0;
  font-size: clamp(2.5rem, 5vw, 3.2rem);
  letter-spacing: -0.05em;
}

.status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: -52px;
  position: relative;
  z-index: 4;
  padding: 18px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.status-bar small {
  color: var(--muted);
  font-weight: 900;
}

.rates-section,
.converter-section {
  padding: 90px 0 0;
}

.section-title {
  max-width: 720px;
  margin-bottom: 26px;
}

.table-card,
.converter-card,
.contact-card,
.map-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.table-card {
  overflow: hidden;
}

.table-tools {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 15px;
  font: inherit;
  font-weight: 850;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(237, 28, 36, 0.55);
  box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.10);
}

.small-btn {
  white-space: nowrap;
  padding: 13px 16px;
  border-radius: 15px;
  background: var(--red);
  color: #fff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 18px 22px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[dir="rtl"] th {
  text-align: right;
}

td {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-weight: 950;
}

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

tbody tr:hover {
  background: #fff8f8;
}

.currency-name {
  display: flex;
  align-items: center;
  gap: 14px;
}

[dir="rtl"] .currency-name {
  flex-direction: row-reverse;
  justify-content: flex-end;
  text-align: right;
}

.flag {
  width: 38px;
  height: 27px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.flag-placeholder {
  width: 38px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f1eeeb;
  font-size: 0.7rem;
  color: var(--muted);
}

.currency-meta {
  display: grid;
  gap: 2px;
}

.currency-meta span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 950;
}

.rate-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f5f1ee;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.rate-pill.sell {
  background: rgba(237, 28, 36, 0.10);
  color: var(--red-dark);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px;
}

.converter-card {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 30px;
  padding: 30px;
  background:
    linear-gradient(135deg, #fff 0%, #fff 55%, rgba(237, 28, 36, 0.06) 100%);
}

.converter-copy {
  align-self: center;
}

.converter-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.converter-form label {
  display: grid;
  gap: 8px;
  font-weight: 950;
  color: var(--muted);
}

.converter-grid-with-swap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

.swap-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.result-box {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 20px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.25;
  font-weight: 1000;
}


.conversion-line {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  text-align: center;
  white-space: normal;
}

.contact-section {
  margin-top: 100px;
  padding: 80px 0;
  background:
    linear-gradient(135deg, rgba(21, 21, 27, 0.96), rgba(109, 10, 14, 0.96)),
    radial-gradient(circle at top right, rgba(237, 28, 36, 0.40), transparent 28rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 22px;
}

.contact-card {
  padding: 30px;
}

.contact-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.contact-list a,
.contact-list span {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #faf7f5;
  font-weight: 950;
  line-height: 1.45;
}

.map-card {
  min-height: 450px;
  overflow: hidden;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  min-height: 450px;
  border: 0;
}

.footer {
  padding: 54px 0 26px;
  background: #111116;
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 36px;
}

.footer-logo {
  width: 180px;
  height: 70px;
  object-fit: contain;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}

.footer h3 {
  margin-bottom: 14px;
}

.footer-links a {
  display: inline-block;
  margin: 6px 0 6px 18px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 850;
}

[dir="rtl"] .footer-links a {
  margin: 6px 18px 6px 0;
}

.footer-links a:hover {
  color: #fff;
}

.copyright {
  width: min(1160px, calc(100% - 36px));
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.68);
  font-weight: 850;
  text-align: center;
}

@media (max-width: 960px) {
  .nav {
    align-items: center;
  }

  .nav-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .brand {
    width: 155px;
    height: 66px;
  }

  .nav-actions,
  .language-switch {
    gap: 4px;
  }

  .nav-actions a,
  .lang-btn {
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .hero-content,
  .converter-card,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-bottom: 112px;
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .time-card {
    justify-self: center;
    text-align: center;
  }

  .converter-copy,
  .section-title {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .table-tools {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 650px) {
  .wrap {
    width: min(100% - 24px, 1160px);
  }

  .nav {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .nav-right {
    width: 100%;
    align-items: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    overflow: visible;
  }

  .nav-actions a {
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.12);
  }

  .language-switch {
    justify-content: center;
    padding: 6px;
  }

  .hero-content {
    min-height: auto;
    padding-top: 20px;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 4.5rem);
  }

  .status-bar {
    justify-content: center;
    text-align: center;
  }

  .rates-section,
  .converter-section {
    padding-top: 70px;
  }

  .converter-card,
  .contact-card {
    padding: 22px;
  }

  .converter-form {
    padding: 16px;
  }

  .converter-grid-with-swap {
    grid-template-columns: 1fr;
  }

  .swap-btn {
    justify-self: center;
    transform: rotate(90deg);
  }

  .swap-btn:hover {
    transform: rotate(90deg) translateY(-2px);
  }

  .contact-card,
  .contact-list a,
  .contact-list span {
    text-align: center;
    justify-content: center;
  }

  .map-card,
  .map-card iframe {
    min-height: 360px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand,
  .footer-links {
    display: grid;
    justify-items: center;
  }

  .footer-links a,
  [dir="rtl"] .footer-links a {
    display: block;
    margin: 10px 0;
  }
}

/* Final mobile/contact polish */
.contact-list a,
.contact-list span {
  font-weight: 600;
}

.contact-item {
  gap: 8px;
}

.phone-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-weight: 600;
}

.contact-icon {
  flex: 0 0 auto;
}

@media (max-width: 650px) {
  .table-wrap {
    overflow-x: hidden;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  th,
  td {
    padding: 9px 7px;
    font-size: 0.78rem;
  }

  th {
    letter-spacing: 0.03em;
    line-height: 1.25;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 44%;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(3),
  td:nth-child(3) {
    width: 28%;
    text-align: center;
  }

  .currency-name {
    gap: 6px;
    min-width: 0;
  }

  [dir="rtl"] .currency-name {
    gap: 6px;
  }

  .flag,
  .flag-placeholder {
    width: 28px;
    height: 20px;
    border-radius: 4px;
    flex: 0 0 auto;
  }

  .currency-meta {
    min-width: 0;
    gap: 0;
  }

  .currency-meta strong,
  .currency-meta span {
    display: block;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .currency-meta strong {
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .currency-meta span {
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .rate-pill {
    min-width: 0;
    width: 100%;
    max-width: 78px;
    padding: 7px 5px;
    font-size: 0.83rem;
    line-height: 1;
  }

  .contact-list a,
  .contact-list span {
    font-weight: 600;
  }

  .contact-item {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  th,
  td {
    padding: 8px 5px;
  }

  .rate-pill {
    max-width: 68px;
    font-size: 0.78rem;
  }

  .currency-meta strong {
    font-size: 0.72rem;
  }

  .currency-meta span {
    font-size: 0.66rem;
  }

  .flag,
  .flag-placeholder {
    width: 25px;
    height: 18px;
  }
}
