/*
 * Tomanify Frontend Widget – Glassmorphism
 *
 * @since 1.0.0
 */
 
.tomanify-widget {
  box-sizing: border-box;
  max-width: 420px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;

  /* Glassmorphism base (colors can be overridden from JS) */
  --tomanify-primary: rgba(37, 99, 235, 0.28);
  --tomanify-primary-strong: rgba(37, 99, 235, 0.9);
  --tomanify-border: rgba(255, 255, 255, 0.55);
  --tomanify-bg-strong: rgba(255, 255, 255, 0.92);
  --tomanify-bg-soft: rgba(255, 255, 255, 0.66);
  --tomanify-text-main: #0f172a;
  --tomanify-text-muted: #6b7280;

  background:
    radial-gradient(circle at 0 0, var(--tomanify-primary), transparent 58%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.02));

  border-radius: 18px;
  border: 1px solid var(--tomanify-border);
  background-clip: padding-box;
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.15),
    0 0 0 1px rgba(15, 23, 42, 0.02);

  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);

  font-size: 13px;
  line-height: 1.6;
  color: var(--tomanify-text-main);

  direction: ltr;
  text-align: left;
}

/* Direction helpers (set from PHP) */
.tomanify-widget.tomanify-ltr {
  direction: ltr;
  text-align: left;
}

.tomanify-widget.tomanify-rtl {
  direction: rtl;
  text-align: right;
}

/* Header: title + time */

.tomanify-widget__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.tomanify-widget__title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tomanify-text-main);
}

.tomanify-widget.tomanify-rtl .tomanify-widget__title {
  text-transform: none;
  letter-spacing: 0.03em;
}

.tomanify-widget__time {
  font-size: 11px;
  color: var(--tomanify-text-muted);
  white-space: nowrap;
}

.tomanify-widget.tomanify-rtl .tomanify-widget__header {
  flex-direction: row-reverse;
}

/* Meta line (Unit) */

.tomanify-widget__meta {
  font-size: 12px;
  color: var(--tomanify-text-muted);
  margin: 0 0 8px;
}

/* LTR → Unit above values column (right side) */
.tomanify-widget.tomanify-ltr .tomanify-widget__meta {
  text-align: right;
  padding-right: 4px;
}

/* RTL → Unit above values column (left side) */
.tomanify-widget.tomanify-rtl .tomanify-widget__meta {
  text-align: left;
  padding-left: 4px;
}

/* Table of rates */

.tomanify-widget__table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  padding: 0;
}

.tomanify-widget__row {
  border-radius: 10px;
  overflow: hidden;
}

/* Striped glass rows */
.tomanify-widget__row:nth-child(odd) .tomanify-widget__cell {
  background: var(--tomanify-bg-strong);
}

.tomanify-widget__row:nth-child(even) .tomanify-widget__cell {
  background: var(--tomanify-bg-soft);
}

.tomanify-widget__cell {
  padding: 7px 8px;
  vertical-align: middle;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

/* First row without top border */
.tomanify-widget__row:first-child .tomanify-widget__cell {
  border-top: none;
}

/* Currency name */
.tomanify-widget__cell--currency {
  font-weight: 500;
  letter-spacing: 0.04em;
}

.tomanify-widget.tomanify-ltr .tomanify-widget__cell--currency {
  text-transform: uppercase;
}

/* Value */
.tomanify-widget__cell--value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tomanify-widget.tomanify-rtl .tomanify-widget__cell--value {
  text-align: left;
}

/* =======================================
   Responsive: tablet and mobile
   ======================================= */

/* Tablet (up to ~iPad portrait) */
@media (max-width: 768px) {
  .tomanify-widget {
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .tomanify-widget__header {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .tomanify-widget__title {
    font-size: 12.5px;
  }

  .tomanify-widget__time {
    font-size: 10.5px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .tomanify-widget {
    max-width: 100%;
    padding: 10px 10px;
    border-radius: 14px;
  }

  .tomanify-widget__header {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .tomanify-widget.tomanify-ltr .tomanify-widget__header {
    justify-content: space-between;
  }

  .tomanify-widget__title {
    font-size: 12px;
  }

  .tomanify-widget__time {
    font-size: 10px;
    white-space: normal;
  }

  .tomanify-widget__meta {
    font-size: 10px;
  }

  .tomanify-widget__cell {
    padding: 6px 6px;
  }
}
