/* Uptex Exchange - Shared Styles */

/* Aller font from cdnfonts */
@import url('https://fonts.cdnfonts.com/css/aller');

/* ============================================
   CSS RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Colors */
  --bg: #0d0d0f;
  --bg-elevated: #141416;
  --bg-card: #18181b;
  --bg-card-hover: #1e1e22;
  --border: #27272a;
  --border-subtle: #1f1f23;

  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --red: #DC0000;
  --red-dark: #a00000;
  --red-glow: rgba(220, 0, 0, 0.15);

  /* Typography */
  --font-heading: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', 'Franklin Gothic Bold', sans-serif;
  --font-body: 'Aller', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --max-width: 800px;
  --radius: 4px;
  --radius-lg: 8px;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  letter-spacing: 0.03em;
}

h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.subtitle {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ============================================
   LAYOUT
   ============================================ */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  padding: var(--space-lg) 0;
  border-bottom: 2px solid var(--red);
  margin-bottom: var(--space-2xl);
}

.site-header__logo {
  display: block;
  height: 28px;
  width: auto;
}

.site-header__logo img {
  height: 28px;
  width: auto;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: var(--space-2xl);
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.page-header .subtitle {
  margin-top: var(--space-xs);
}

/* ============================================
   CALLOUT / NOTICE BOX
   ============================================ */
.callout {
  background: var(--bg-elevated);
  border-left: 3px solid var(--red);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-2xl);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.callout--warning {
  border-left-color: #f59e0b;
}

.callout strong {
  color: var(--text);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: #3f3f46;
}

.card--link {
  display: block;
  cursor: pointer;
}

.card--link:hover {
  background: var(--bg-card-hover);
}

.card--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.card__header {
  padding: var(--space-md) var(--space-lg);
  background: var(--red);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card__header h2,
.card__header h3 {
  color: #fff;
  margin: 0;
}

.card__body {
  padding: var(--space-lg);
}

.card__body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   CURRENCY CARD
   ============================================ */
.currency-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.currency-card__header {
  padding: var(--space-md) var(--space-lg);
  background: var(--red);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.currency-card__code {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.currency-card__flag {
  font-size: 1.4rem;
  line-height: 1;
}

.currency-card__name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.currency-card__body {
  padding: var(--space-lg);
}

.currency-card__subsection {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.currency-card__subsection-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

/* ============================================
   DETAIL ROWS (two-column label:value)
   ============================================ */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 140px;
  font-weight: 500;
  padding-top: 2px;
}

.detail-row__value {
  font-size: 0.95rem;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.detail-row__value--mono {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* Copy button */
.copy-wrapper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.copy-btn--copied {
  color: #22c55e;
  border-color: #22c55e;
}

/* ============================================
   BADGE / PILL
   ============================================ */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 100px;
  line-height: 1.4;
  vertical-align: middle;
}

.badge--muted {
  background: var(--border);
  color: var(--text-muted);
}

.badge--red {
  background: var(--red);
  color: #fff;
}

.badge--green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

/* ============================================
   TABLE
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--red);
}

thead th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--bg-elevated);
}

/* ============================================
   DIRECTORY CARDS (index page)
   ============================================ */
.directory-grid {
  display: grid;
  gap: var(--space-md);
}

.directory-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.15s ease;
  text-decoration: none;
}

.directory-card:hover {
  border-color: var(--red);
  background: var(--bg-card-hover);
}

.directory-card--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.directory-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--red-glow);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}

.directory-card__icon svg {
  width: 22px;
  height: 22px;
}

.directory-card__content {
  flex: 1;
}

.directory-card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.directory-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   NOTES LIST
   ============================================ */
.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes-list li {
  position: relative;
  padding: var(--space-sm) 0 var(--space-sm) var(--space-lg);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border-subtle);
}

.notes-list li:last-child {
  border-bottom: none;
}

.notes-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
}

/* ============================================
   SUPPORT SECTION
   ============================================ */
.support-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-top: var(--space-2xl);
}

.support-section h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.support-section p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.support-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-muted);
  transition: text-decoration-color 0.15s ease;
}

.support-section a:hover {
  text-decoration-color: var(--red);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  padding-bottom: var(--space-lg);
}

.site-footer__legal {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.site-footer__links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.site-footer__links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: all 0.15s ease;
}

.site-footer__links a:hover {
  color: var(--text-secondary);
  text-decoration-color: var(--text-secondary);
}

.site-footer__contact {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-footer__contact a {
  color: var(--text-secondary);
}

.site-footer__copyright {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .page-wrapper {
    padding: var(--space-md) var(--space-md);
  }

  .site-header {
    margin-bottom: var(--space-xl);
  }

  .detail-row {
    flex-direction: column;
    gap: 2px;
  }

  .detail-row__label {
    min-width: auto;
  }

  .detail-row__value {
    text-align: left;
  }

  .directory-card {
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .currency-card__body {
    padding: var(--space-md);
  }

  .currency-card__header {
    padding: var(--space-sm) var(--space-md);
  }

  .site-footer__links {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ============================================
   DISCLAIMER
   ============================================ */
.disclaimer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.disclaimer-bar {
    width: 40px;
    height: 3px;
    background: #DC0000;
    margin-bottom: 1rem;
}
.disclaimer p {
    font-size: 0.7rem;
    color: #52525b;
    line-height: 1.6;
    margin-bottom: 0.6rem;
}
.disclaimer strong {
    color: #71717a;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border-color: #ccc !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .page-wrapper {
    max-width: 100%;
    padding: 0;
  }

  .site-header {
    border-bottom-color: black !important;
    padding-bottom: 12pt;
    margin-bottom: 18pt;
  }

  .site-header__logo img {
    /* Logo won't print well inverted - rely on alt text */
    filter: invert(1);
  }

  .currency-card {
    page-break-inside: avoid;
    border: 1pt solid #ccc !important;
    margin-bottom: 12pt;
  }

  .currency-card__header {
    background: #DC0000 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .currency-card__header * {
    color: white !important;
  }

  .callout {
    border-left: 3pt solid #DC0000 !important;
    background: #f5f5f5 !important;
    padding: 8pt 12pt;
  }

  .copy-btn {
    display: none !important;
  }

  .site-footer {
    border-top: 1pt solid #ccc !important;
    margin-top: 24pt;
    padding-top: 12pt;
  }

  .support-section {
    border: 1pt solid #ccc !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666 !important;
  }

  .site-header a[href]::after,
  .copy-btn::after {
    content: none;
  }

  .no-print {
    display: none !important;
  }
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.site-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  transition: all 0.2s;
  margin-right: 0.5rem;
}

.site-nav__home:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.site-nav__home svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.site-nav__sep {
  color: rgba(255,255,255,0.15);
  font-size: 0.7rem;
  margin: 0 0.15rem;
  user-select: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.site-nav__link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.site-nav__link--active {
  color: var(--text);
  background: rgba(220, 0, 0, 0.1);
  border-color: rgba(220, 0, 0, 0.2);
}

@media (max-width: 600px) {
  .site-nav {
    gap: 0.2rem;
    padding: 0.6rem 0;
  }
  .site-nav__link, .site-nav__home {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }
  .site-nav__sep {
    display: none;
  }
}

@media print {
  .site-nav { display: none; }
}
