/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #c8102e;
  --primary-dark: #a00d25;
  --primary-light: #e63946;
  --secondary-color: #00a859;
  --secondary-light: #26c77e;
  --accent-color: #ffc107;
  --text-dark: #1a1a1a;
  --text-medium: #4a4a4a;
  --text-light: #666;
  --bg-light: #f8f9fa;
  --bg-lighter: #fafbfc;
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.12);
  --card-shadow-soft: 0 2px 8px rgba(0,0,0,0.04);
  --max-width: 1200px;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text-dark);
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

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

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2.5rem 0;
  box-shadow: 0 8px 32px rgba(200, 16, 46, 0.25);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-20px, 20px) rotate(180deg); }
}

header .container {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header .subtitle {
  opacity: 0.95;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.3px;
}

nav {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

nav.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  color: var(--text-medium);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 0.6rem 0.5rem;
  position: relative;
  border-radius: var(--border-radius-sm);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover {
  color: var(--primary-color);
  background: rgba(200, 16, 46, 0.05);
}

nav a:hover::after {
  width: 80%;
}

/* Language Switcher */
.lang-switcher {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-light);
  padding: 0.25rem;
  border-radius: 8px;
}

.lang-switcher a {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lang-switcher a.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(200, 16, 46, 0.2);
}

.lang-switcher a:not(.active):hover {
  background: rgba(200, 16, 46, 0.1);
  color: var(--primary-color);
}

/* Main Content */
main {
  padding: 3rem 0;
  min-height: calc(100vh - 300px);
}

main h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

main > .container > h1 {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rate Display Card */
.rate-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.25rem 1rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 0;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.rate-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.03) 0%, transparent 70%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.rate-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: rgba(200, 16, 46, 0.2);
}

.rate-card:hover::after {
  opacity: 1;
}

.rate-card .main-rate {
  font-size: clamp(1.1rem, 2.2vw, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.75rem 0 0.15rem 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  transition: var(--transition);
  white-space: nowrap;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.1;
  overflow: visible;
  word-break: keep-all;
  min-width: 0;
  text-align: center;
  padding: 0;
}

.rate-card .currency-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.rate-card:hover .main-rate {
  transform: scale(1.02);
}

.rate-card .rate-label {
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  color: var(--text-medium);
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rate-card .secondary-price {
  font-size: clamp(0.7rem, 1.1vw, 0.9rem);
  color: var(--secondary-color);
  font-weight: 600;
  margin-top: 0.5rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
  max-width: 100%;
  box-sizing: border-box;
}

.rate-card .helper-text {
  font-size: clamp(0.6rem, 0.9vw, 0.75rem);
  color: var(--text-light);
  margin-top: 0.35rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
  max-width: 100%;
  box-sizing: border-box;
}

.rate-card .card-footer {
  margin-top: auto;
  padding-top: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.rate-card .card-footer a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.rate-card .rate-change {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.5rem;
}

.rate-card .rate-change.positive {
  background: #e8f5e9;
  color: #2e7d32;
}

.rate-card .rate-change.negative {
  background: #ffebee;
  color: #c62828;
}

.last-updated {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Buy/Sell Rates Display */
.buy-sell-rates {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 0.75rem 0;
  padding: 0.5rem 0.35rem;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.02), rgba(0, 168, 89, 0.02));
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.rate-card:hover .buy-sell-rates {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  border-color: rgba(200, 16, 46, 0.15);
}

.buy-sell-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.buy-sell-label {
  font-size: clamp(0.6rem, 0.9vw, 0.75rem);
  color: var(--text-medium);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.buy-sell-value {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  font-weight: 700;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 100%;
  box-sizing: border-box;
  display: inline-block;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
}

.data-table th {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  padding: 1.5rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
}

body[dir="rtl"] .data-table th {
  text-align: right;
}

.data-table td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr {
  transition: var(--transition);
}

.data-table tr:hover {
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.03), rgba(0, 168, 89, 0.03));
  transform: scale(1.01);
}

.data-table tr:hover td {
  color: var(--primary-color);
}

.data-table td strong {
  font-weight: 600;
  transition: var(--transition);
}

.data-table tr:hover td strong {
  color: var(--primary-color);
}

/* Sections */
.section {
  margin: 2.5rem 0;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 1rem;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.section:hover h2::after {
  width: 120px;
}

.section h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-dark);
}

/* FAQ */
.faq-item {
  background: white;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  border: 1px solid var(--border-light);
  border-left: 4px solid transparent;
  transition: var(--transition);
}

.faq-item:hover {
  box-shadow: var(--card-shadow-hover);
  border-left-color: var(--primary-color);
  transform: translateX(6px);
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.02), white);
}

.faq-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.faq-item p {
  color: var(--text-medium);
  line-height: 1.8;
}

/* Converter */
.converter-form {
  background: white;
  padding: 2.75rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  max-width: 550px;
  margin: 2rem auto;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.converter-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.converter-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-medium);
  font-size: 0.95rem;
}

.converter-form input,
.converter-form select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
  background: var(--bg-lighter);
  font-weight: 500;
}

.converter-form input:hover,
.converter-form select:hover {
  border-color: var(--primary-light);
  background: white;
}

.converter-form input:focus,
.converter-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
  transform: translateY(-1px);
}

.converter-result {
  margin-top: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  border-radius: var(--border-radius-sm);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--primary-color);
  border: 2px solid var(--border-light);
  font-variant-numeric: tabular-nums;
  transition: var(--transition);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.converter-result:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.15);
}

/* Common Conversions */
.conversion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.conversion-item {
  background: white;
  padding: 1.75rem 1.25rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  text-align: center;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.conversion-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.conversion-item:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.conversion-item:hover::before {
  transform: scaleX(1);
}

.conversion-item .amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Internal Links */
.internal-links {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.02), rgba(0, 168, 89, 0.02));
  padding: 2.5rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow-soft);
}

.internal-links h3 {
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dark);
}

.internal-links ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.internal-links a {
  color: var(--primary-color);
  text-decoration: none;
  padding: 0.875rem 1.25rem;
  display: block;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  font-weight: 500;
  background: white;
  border: 1px solid var(--border-light);
  position: relative;
}

.internal-links a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.internal-links a:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  transform: translateX(6px);
  box-shadow: var(--card-shadow);
  border-color: var(--primary-color);
  padding-left: 2rem;
}

.internal-links a:hover::before {
  width: 4px;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--text-dark), #2a2a2a);
  color: white;
  padding: 3.5rem 0 2rem;
  margin-top: 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

footer p {
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

footer a {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
  transition: all 0.2s ease;
  font-weight: 500;
}

footer a:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* Ad Placeholders */
.ad-container {
  margin: 2rem 0;
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-light), white);
  border-radius: var(--border-radius-sm);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  border: 2px dashed var(--border-color);
  transition: var(--transition);
}

.ad-container:hover {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.02), rgba(0, 168, 89, 0.02));
}

.ad-container.top {
  margin-top: 0;
}

.ad-container.bottom {
  margin-bottom: 0;
}

/* Buttons */
button, .btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
  position: relative;
  overflow: hidden;
}

button::before, .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

button:hover::before, .btn:hover::before {
  left: 100%;
}

button:hover, .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(200, 16, 46, 0.35);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

button:active, .btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

/* Links in content */
main a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

main a:hover {
  border-bottom-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 2rem 0;
  }

  header h1 {
    font-size: 1.75rem;
  }

  header .subtitle {
    font-size: 0.9rem;
  }

  main {
    padding: 2rem 0;
  }

  main h1 {
    font-size: 2rem;
  }

  .rate-card {
    padding: 2rem 1.5rem;
  }

  .rate-card .main-rate {
    font-size: clamp(2rem, 6vw, 2.75rem);
  }

  nav {
    padding: 1rem 0;
  }

  nav ul {
    gap: 0.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
  }

  nav a {
    padding: 0.5rem 0.4rem;
  }

  .container {
    padding: 0 16px;
  }

  .data-table {
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
  }

  .data-table th {
    padding: 1rem 0.75rem;
    font-size: 0.8rem;
  }

  .data-table td {
    padding: 1rem 0.75rem;
  }

  .section {
    margin: 2rem 0;
  }

  .section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
  }

  .converter-form {
    padding: 2rem 1.5rem;
  }

  .buy-sell-rates {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem;
  }

  .buy-sell-value {
    font-size: 1.15rem;
  }

  .internal-links {
    padding: 1.75rem;
  }

  .internal-links ul {
    grid-template-columns: 1fr;
  }

  .conversion-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.875rem;
  }

  .conversion-item {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  .rate-card .main-rate {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
  }

  .rate-card {
    padding: 1.75rem 1.25rem;
  }

  main h1 {
    font-size: 1.75rem;
  }

  .converter-form {
    padding: 1.5rem;
  }

  .converter-result {
    padding: 1.5rem;
    font-size: 1.25rem;
  }
}

/* RTL Support */
body[dir="rtl"] {
  direction: rtl;
}

body[dir="rtl"] nav ul {
  flex-direction: row-reverse;
}

body[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: auto;
}

/* Loading and Animation States */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus States for Accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

nav a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

/* Selection */
::selection {
  background: rgba(200, 16, 46, 0.2);
  color: var(--text-dark);
}

::-moz-selection {
  background: rgba(200, 16, 46, 0.2);
  color: var(--text-dark);
}

/* Scrollbar Styling (Webkit browsers) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

/* Smooth page transitions */
html {
  scroll-padding-top: 80px;
}

/* Home Cards Grid */
.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  min-width: 0;
  width: 100%;
}

@media (min-width: 1200px) {
  .home-cards-grid {
    gap: 1.25rem;
  }
  
  .rate-card {
    padding: 1.5rem 1.25rem;
    min-height: 280px;
  }
  
  .rate-card .main-rate {
    font-size: clamp(1.4rem, 2.5vw, 2.25rem);
    margin: 0.75rem 0 0.2rem 0;
  }
  
  .buy-sell-rates {
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
  }
  
  .buy-sell-value {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  }
}

@media (max-width: 1200px) {
  .home-cards-grid {
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
  }
  
  .rate-card {
    padding: 1rem 0.75rem;
    min-height: 220px;
  }
  
  .rate-card .main-rate {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin: 0.5rem 0 0.15rem 0;
  }
  
  .buy-sell-rates {
    gap: 0.5rem;
    padding: 0.4rem 0.25rem;
  }
  
  .buy-sell-value {
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
  }
  
  .rate-card .secondary-price {
    font-size: clamp(0.65rem, 1.1vw, 0.85rem);
    padding: 0 0.25rem;
  }
}

@media (max-width: 900px) {
  .home-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .rate-card {
    padding: 1.25rem 1rem;
    min-height: auto;
  }
  
  .rate-card .main-rate {
    font-size: 1.75rem;
  }
  
  .rate-card .rate-label {
    font-size: 0.75rem;
  }
  
  .rate-card .secondary-price {
    font-size: 0.85rem;
  }
  
  .buy-sell-value {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .home-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .rate-card {
    min-height: auto;
    padding: 1.5rem;
  }
  
  .rate-card .main-rate {
    font-size: 2rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Gold Page Enhancements */

/* Answer Snippet (Feature 60) */
.answer-snippet {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--border-radius-sm);
}

.snippet-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.snippet-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Page Controls (Features 8, 9) */
.page-controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: var(--border-radius-sm);
  flex-wrap: wrap;
}

.control-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.control-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.control-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-select select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: white;
  cursor: pointer;
}

/* Status Indicator (Feature 5) */
.status-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: white;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator[data-status="live"] {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-indicator[data-status="live"] .status-dot {
  background: #4caf50;
  animation: pulse 2s infinite;
}

.status-indicator[data-status="delayed"] {
  background: #fff3e0;
  color: #e65100;
}

.status-indicator[data-status="delayed"] .status-dot {
  background: #ff9800;
}

.status-indicator[data-status="offline"] {
  background: #ffebee;
  color: #c62828;
}

.status-indicator[data-status="offline"] .status-dot {
  background: #f44336;
}

.last-updated-header {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-medium);
}

.update-frequency {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

/* Source Transparency (Feature 4) */
.source-transparency {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-lighter);
  border-radius: var(--border-radius-sm);
}

.source-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.method-toggle {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  text-decoration: underline;
}

.method-toggle:hover {
  color: var(--primary-dark);
}

.method-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0.5rem;
}

.method-details.expanded {
  max-height: 500px;
  padding-top: 1rem;
}

.method-details p {
  margin: 0.5rem 0;
  color: var(--text-medium);
  line-height: 1.6;
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  margin-left: 0.25rem;
}

.method-details.expanded ~ .method-toggle .toggle-icon,
.method-toggle:has(+ .method-details.expanded) .toggle-icon {
  transform: rotate(180deg);
}

/* Action Buttons (Features 6, 7) */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.copy-price-btn,
.whatsapp-share-btn,
.telegram-share-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.copy-price-btn:hover,
.whatsapp-share-btn:hover,
.telegram-share-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.copy-price-btn.copied {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

/* Arabic Aliases (Feature 59) */
.arabic-alias {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-left: 0.5rem;
  font-weight: normal;
}

/* Pinned Karat (Feature 9) */
.pinned-karat {
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.1), rgba(200, 16, 46, 0.05)) !important;
  border-left: 4px solid var(--primary-color) !important;
}

/* Screenshot Mode (Feature 8) */
body.screenshot-mode nav,
body.screenshot-mode header,
body.screenshot-mode footer,
body.screenshot-mode .ad-container,
body.screenshot-mode .action-buttons,
body.screenshot-mode .internal-links,
body.screenshot-mode .cross-links-module,
body.screenshot-mode .today-widget,
body.screenshot-mode .gold-faq {
  display: none !important;
}

/* Keep screenshot mode toggle visible even in screenshot mode */
body.screenshot-mode .page-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 2px solid var(--primary-color);
}

body.screenshot-mode .data-table {
  box-shadow: none;
  border: 1px solid var(--border-color);
}

/* Calculators (Features 10-14) */
.gold-calculators {
  margin: 3rem 0;
}

.calculator-widget {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  border: 1px solid var(--border-light);
}

.calculator-widget h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.widget-description {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--text-medium);
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.calculator-result {
  margin-top: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--border-light);
}

.result-value {
  text-align: center;
}

.result-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.result-secondary {
  font-size: 1.1rem;
  color: var(--text-medium);
  font-weight: 600;
}

.result-detail {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-medium);
  text-align: center;
}

.preset-buttons {
  margin-top: 1.5rem;
}

.preset-buttons h4 {
  font-size: 0.9rem;
  color: var(--text-medium);
  margin: 1rem 0 0.5rem;
}

.preset-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preset-gram-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.preset-gram-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Price Units (Features 15-20) */
.gold-price-units {
  margin: 3rem 0;
}

.price-units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.price-unit-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.price-unit-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.unit-label {
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.unit-price-usd {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.unit-price-lbp {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}

.derived-estimates {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}

.estimate-note {
  font-size: 0.85rem;
  color: var(--text-medium);
  font-style: italic;
  margin-bottom: 1rem;
}

.estimate-card {
  border: 2px dashed var(--border-color);
}

.estimate-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent-color);
  color: var(--text-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* History Stats (Features 21-27) */
.gold-history {
  margin: 3rem 0;
}

.history-stats-container {
  margin: 1.5rem 0;
}

.history-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  border: 1px solid var(--border-light);
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-value.positive {
  color: var(--secondary-color);
}

.stat-value.negative {
  color: #c62828;
}

.stat-secondary {
  font-size: 0.9rem;
  color: var(--text-medium);
  margin-top: 0.25rem;
}

.volatility-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.volatility-badge.low {
  background: #e8f5e9;
  color: #2e7d32;
}

.volatility-badge.medium {
  background: #fff3e0;
  color: #e65100;
}

.volatility-badge.high {
  background: #ffebee;
  color: #c62828;
}

.history-note {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-lighter);
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  color: var(--text-medium);
}

/* Cross Links (Feature 64) */
.cross-links-module {
  margin: 3rem 0;
}

.cross-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.cross-link-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
  border: 1px solid var(--border-light);
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cross-link-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.link-icon {
  font-size: 2rem;
}

.link-title {
  font-weight: 600;
  font-size: 1rem;
}

.link-desc {
  font-size: 0.85rem;
  color: var(--text-medium);
}

/* Today Widget (Feature 65) */
.today-widget {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.02), rgba(0, 168, 89, 0.02));
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  margin: 2rem 0;
}

.today-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.today-number {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-soft);
}

.number-label {
  font-size: 0.85rem;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.number-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}


/* Sharing Actions (Feature 71) */
.sharing-actions {
  margin: 2rem 0;
  text-align: center;
}

.copy-summary-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-dark);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--card-shadow-hover);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--secondary-color);
}

.toast-error {
  background: #c62828;
}

/* Highlighted Row */
.highlighted {
  animation: highlight 2s ease;
}

@keyframes highlight {
  0%, 100% { background: transparent; }
  50% { background: rgba(200, 16, 46, 0.2); }
}

/* SEO Page Styles */
.seo-price-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin: 2rem 0;
  text-align: center;
  border: 2px solid var(--primary-color);
}

.seo-price-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.seo-price-label {
  font-size: 1rem;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.seo-price-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

.seo-price-secondary {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.seo-calculator-preset {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.05), rgba(0, 168, 89, 0.05));
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  margin: 2rem 0;
  border-left: 4px solid var(--primary-color);
}

.seo-calculator-preset h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.preset-result {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.seo-main-link {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-lighter);
  border-radius: var(--border-radius-sm);
}

.city-note {
  margin: 1rem 0;
  padding: 1rem;
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  border-radius: var(--border-radius-sm);
}

.city-note p {
  margin: 0;
  color: #e65100;
  font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .page-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .status-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .price-units-grid,
  .history-stats-grid,
  .cross-links-grid {
    grid-template-columns: 1fr;
  }
  
  .today-numbers {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calculator-widget {
    padding: 1.5rem;
  }
  
  .seo-price-value {
    font-size: 2rem;
  }
  
  .seo-price-secondary {
    font-size: 1.2rem;
  }
}

/* Latest Loto Results Widget Styles */
.loto-widget {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin: 2rem 0;
}

.loto-widget h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.loto-content {
  min-height: 100px;
}

.loto-loading,
.loto-error {
  text-align: center;
  padding: 2rem;
  color: var(--text-medium);
}

.loto-error {
  color: var(--primary-color);
}

.loto-draw-info {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.loto-balls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.loto-main-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.loto-extra-ball {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  position: relative;
}

.loto-extra-ball::before {
  content: 'Extra';
  position: absolute;
  top: -1.5rem;
  font-size: 0.85rem;
  color: var(--text-medium);
  font-weight: 500;
}

.loto-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.loto-ball:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.loto-ball-main {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.loto-ball-extra {
  background: linear-gradient(135deg, var(--accent-color) 0%, #ff9800 100%);
  width: 55px;
  height: 55px;
  font-size: 1.35rem;
}

.loto-meta {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.loto-updated {
  font-size: 0.9rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.5rem;
}

.loto-note {
  font-size: 0.85rem;
  color: var(--text-medium);
  font-style: italic;
  margin: 0.5rem 0 0 0;
}

/* Responsive adjustments for Loto widget */
@media (max-width: 768px) {
  .loto-widget {
    padding: 1.5rem;
  }
  
  .loto-ball {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .loto-ball-extra {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  
  .loto-main-balls {
    gap: 0.5rem;
  }
}