@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Noto+Sans+Arabic:wght@300;400;600;700&display=swap');

:root {
  --primary: hsl(214, 80%, 45%);
  --primary-dark: hsl(214, 80%, 32%);
  --primary-light: hsl(214, 80%, 90%);
  --accent: hsl(43, 96%, 56%);
  --bg-gradient: linear-gradient(135deg, hsl(210, 20%, 98%) 0%, hsl(210, 20%, 92%) 100%);
  --text-main: hsl(220, 39%, 11%);
  --text-muted: hsl(220, 15%, 40%);
  --surface: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --side-menu-bg: hsl(210, 20%, 97%);
}

/* Explicit Dark Theme variables - Light theme is default */
html[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, hsl(220, 40%, 8%) 0%, hsl(220, 40%, 12%) 100%);
  --text-main: hsl(0, 0%, 98%);
  --text-muted: hsl(220, 15%, 70%);
  --surface: rgba(20, 25, 35, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --primary-light: rgba(24, 80, 136, 0.15);
  --primary-dark: hsl(214, 80%, 45%);
  --side-menu-bg: hsl(220, 40%, 12%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Noto Sans Arabic', sans-serif;
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Glassmorphism Reusable Elements */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

/* Header Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
}

.brand {
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.brand:hover {
  transform: scale(1.02);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

/* Hero Section */
.hero {
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInUp 0.8s ease forwards;
}

.badge {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, hsl(180, 70%, 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Call to Action Buttons */
.cta-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: 100px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 20px rgba(24, 80, 136, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(24, 80, 136, 0.6);
}

/* Visual Mockup/Hero Image Area */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: floatAnim 6s ease-in-out infinite alternate;
}

.mockup-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  border: 4px solid var(--border);
}

.mockup-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Live Exchange Rates Demonstration Panel */
.features-grid {
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(24, 80, 136, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Privacy Policy Layout */
.policy-page {
  max-width: 800px;
  margin: 3rem auto;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.policy-page h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.policy-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.policy-section h2 {
  font-size: 1.5rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.policy-section p, .policy-section li {
  color: var(--text-muted);
}

.policy-section ul {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatAnim {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-15px) rotate(1deg);
  }
}

/* Responsive Scaling */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .badge {
    align-self: center;
  }
  .cta-group {
    justify-content: center;
  }
  h1 {
    font-size: 2.75rem;
  }
}

/* Language Toggle Button styling */
.lang-btn {
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
}

.lang-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Global Market Marquee & Card Grid Styling */
#global-ticker-tape-container {
  max-width: 1200px;
  margin: 0.5rem auto 1.5rem;
  padding: 0 2rem;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}

.global-markets-section {
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  width: 100%;
}

.global-markets-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.global-markets-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--primary) 0%, hsl(180, 70%, 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.global-markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.tv-card-container {
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.tv-card-container:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .tv-card-container:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Glassmorphic Skeletal Shimmer Placeholder */
.tv-card-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 1rem;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.tv-skeleton-line {
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 37%, rgba(0,0,0,0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

html[data-theme="dark"] .tv-skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
}

.tv-skeleton-title {
  width: 50%;
  height: 22px;
}

.tv-skeleton-price {
  width: 70%;
  height: 32px;
}

.tv-skeleton-chart {
  flex: 1;
  width: 100%;
  border-radius: 8px;
}

/* Fallback Warning Card Design */
.tv-fallback-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  height: 100%;
  box-sizing: border-box;
}

.tv-fallback-icon {
  font-size: 2rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.tv-fallback-text {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Exchange Rates Page styling */
.rates-container {
  max-width: 1000px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
  width: 100%;
}

.rates-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
}

.rates-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rates-title-section h1 {
  font-size: 2.25rem;
}

/* Currency Selection Bar */
.currency-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.35rem;
  border-radius: 100px;
  border: 1px solid var(--border);
}

html[data-theme="dark"] .currency-selector {
  background: rgba(255, 255, 255, 0.05);
}

.currency-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.currency-tab:hover {
  color: var(--text-main);
}

.currency-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(24, 80, 136, 0.25);
}

/* Rates Table */
.rates-table-wrapper {
  overflow-x: auto;
  border-radius: 24px;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

html[dir="rtl"] .rates-table {
  text-align: right;
}

.rates-table th {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid var(--border);
}

html[data-theme="dark"] .rates-table th {
  background: rgba(255, 255, 255, 0.02);
}

.rates-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 500;
}

.rates-table tr:last-child td {
  border-bottom: none;
}

.rates-table tr:hover td {
  background: rgba(24, 80, 136, 0.04);
}

/* Skeleton Loading Shimmer */
.shimmer-row td div {
  height: 20px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 37%, rgba(0, 0, 0, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}

html[data-theme="dark"] .shimmer-row td div {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Error state UI */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}

.error-state-icon {
  font-size: 3rem;
}

.btn-retry {
  padding: 0.5rem 1.5rem;
  font-size: 0.95rem;
  background: var(--primary);
  color: white;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.btn-retry:hover {
  background: var(--primary-dark);
}

/* Bank Name Layout & Logo Elements */
.bank-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bank-logo-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.bank-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  object-fit: contain;
  box-sizing: border-box;
}

.bank-logo-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  user-select: none;
  box-sizing: border-box;
}

/* Play Store Button (Glassmorphic CTA) */
.playstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 1.25rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.playstore-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 80, 136, 0.3);
}

.playstore-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Footer Link and Button Flex Container */
.footer-links-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  width: 100%;
}

@media (max-width: 768px) {
  .footer-links-wrapper {
    flex-direction: column;
    gap: 1.25rem;
  }
}

/* Hero playstore button with pulsing ring */
.hero-playstore-btn {
  padding: 0.875rem 2rem;
  border-radius: 100px;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(24, 80, 136, 0.4);
  position: relative;
}

.hero-playstore-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 100px;
  border: 2px solid var(--primary);
  animation: pulse-ring 2s cubic-bezier(0.25, 0, 0, 1) infinite;
  opacity: 0;
  pointer-events: none;
}

.hero-playstore-btn:hover::after {
  opacity: 1;
}

.hero-playstore-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(24, 80, 136, 0.6);
}

.hero-playstore-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}


/* Mobile-Friendly Rates Custom Media Queries */
@media (max-width: 480px) {
  /* Scrollable single-row mobile navbar */
  header {
    padding: 0.5rem !important;
  }
  .nav-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    gap: 1.25rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    scrollbar-width: none; /* Hide standard Firefox scrollbar */
  }
  .nav-container::-webkit-scrollbar {
    display: none !important; /* Hide Safari and Chrome scrollbar */
  }
  .brand, .nav-links, .lang-toggle-container {
    flex-shrink: 0 !important;
  }
  .brand {
    font-size: 1.25rem !important;
  }
  .nav-links {
    gap: 0.75rem !important;
  }

  /* Dynamic font scale & paddings compression */
  .rates-container {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }
  .rates-header-panel {
    padding: 1rem;
    gap: 1rem;
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .rates-title-section {
    align-items: center;
  }
  .rates-title-section h1 {
    font-size: 1.6rem;
  }
  .rates-title-section .subtitle {
    font-size: 0.95rem;
  }

  /* Currency selector wraps beautifully instead of horizontal scrolling */
  .currency-selector {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    width: 100%;
    padding: 0.25rem;
    gap: 0.25rem;
  }
  .currency-tab {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    flex: 1 1 auto;
    text-align: center;
  }

  /* Table layout overrides */
  .rates-table-wrapper {
    border-radius: 16px;
  }
  .rates-table th, .rates-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }
  .rates-table td {
    font-size: 0.85rem;
  }

  /* Bank cell layout wrapping */
  .bank-name-cell {
    gap: 8px;
  }
  .bank-logo-wrapper, .bank-logo, .bank-logo-fallback {
    width: 22px;
    height: 22px;
  }
  .bank-logo-fallback {
    font-size: 0.7rem;
  }
  
  .bank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .bank-title {
    font-weight: 600;
  }
  .bank-timestamp {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
  }
  
  /* Update Button styling adjustment */
  .update-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Bank info & timestamp base styles */
.bank-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bank-timestamp {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

/* Interactive Update Button and Shimmer skeleton updates */
.update-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(24, 80, 136, 0.25);
}

.update-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.update-btn:disabled {
  background: var(--text-muted);
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.update-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.5s ease;
}

.update-btn.updating svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Theme Toggle Button custom styling */
.theme-btn {
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.theme-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Hidden elements depending on active theme states */
html[data-theme="dark"] .theme-btn .sun-icon {
  display: inline-block;
}
html[data-theme="dark"] .theme-btn .moon-icon {
  display: none;
}
html:not([data-theme="dark"]) .theme-btn .sun-icon {
  display: none;
}
html:not([data-theme="dark"]) .theme-btn .moon-icon {
  display: inline-block;
}

/* ==========================================================================
   Home Page Highest Buyer Rates Panel & Cards Styling
   ========================================================================== */

#highest-buyer-rates-container {
  max-width: 1200px;
  margin: -1.5rem auto 2.5rem;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

.highest-rates-title {
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highest-rates-title::before {
  content: '🏆';
  font-size: 1.4rem;
}

html[dir="rtl"] .highest-rates-title::before {
  content: '🏆';
}

.highest-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Glassmorphic Cards */
.highest-rate-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  text-decoration: none !important;
  color: var(--text-main) !important;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.highest-rate-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(24, 80, 136, 0.15);
}

html[data-theme="dark"] .highest-rate-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Card Header */
.highest-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.highest-card-currency {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highest-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  background: rgba(24, 80, 136, 0.1);
  color: var(--primary);
}

/* Card Rate Details */
.highest-card-rate-container {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.highest-card-rate-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.highest-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.highest-card-rate {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.highest-card-rate span {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.25rem;
  color: var(--text-muted);
}

html[dir="rtl"] .highest-card-rate span {
  margin-left: 0;
  margin-right: 0.25rem;
}

/* Bank Details Row */
.highest-card-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.highest-card-bank-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeletal Loading Shimmers */
.highest-skeleton-card {
  height: 165px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
}

.highest-skeleton-line {
  background: linear-gradient(90deg, rgba(0,0,0,0.05) 25%, rgba(0,0,0,0.1) 37%, rgba(0,0,0,0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

html[data-theme="dark"] .highest-skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
}

.highest-skeleton-top {
  width: 45%;
  height: 20px;
}

.highest-skeleton-mid {
  width: 70%;
  height: 32px;
}

.highest-skeleton-bottom {
  width: 90%;
  height: 24px;
  margin-top: auto;
}

/* ==========================================================================
   Interactive Rates Table Sorting Styles
   ========================================================================== */

.sortable-header {
  cursor: pointer !important;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.sortable-header:hover {
  background-color: rgba(24, 80, 136, 0.08) !important;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: bold;
  transition: transform 0.2s ease, color 0.2s ease;
  vertical-align: middle;
}

html[dir="rtl"] .sort-indicator {
  margin-left: 0;
  margin-right: 0.4rem;
}

.sortable-header.sorted-desc .sort-indicator {
  color: var(--primary);
  transform: translateY(0);
}

.sortable-header.sorted-asc .sort-indicator {
  color: var(--primary);
  transform: translateY(0);
}

/* Responsive Overrides for Cards Grid */
@media (max-width: 768px) {
  #highest-buyer-rates-container {
    margin: -0.5rem auto 2rem;
    padding: 0 1rem;
  }
  
  .highest-rates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .highest-rates-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* EGP Rates Trend Indicator Scopes */
.rate-trend-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.25rem;
  font-family: 'Outfit', 'Noto Sans Arabic', sans-serif;
}
.rate-trend-container.positive {
  color: #10b981; /* Emerald Green */
}
.rate-trend-container.negative {
  color: #ef4444; /* Crimson Red */
}
.rate-trend-container .trend-arrow {
  font-size: 0.62rem;
  display: inline-block;
  line-height: 1;
}

/* Glassmorphic Landing Card Badges */
.best-buy-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 0.35rem;
  font-family: 'Outfit', 'Noto Sans Arabic', sans-serif;
  animation: fadeIn 0.4s ease forwards;
}
.best-buy-trend.positive {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.best-buy-trend.negative {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.best-buy-trend .trend-arrow {
  font-size: 0.58rem;
}

/* Dark Mode Accessibility Color Tuning */
html[data-theme="dark"] .rate-trend-container.positive,
html[data-theme="dark"] .best-buy-trend.positive {
  color: #34d399; /* Vibrant Emerald on Dark */
}
html[data-theme="dark"] .rate-trend-container.negative,
html[data-theme="dark"] .best-buy-trend.negative {
  color: #f87171; /* Vibrant Crimson on Dark */
}
html[data-theme="dark"] .best-buy-trend.positive {
  background: rgba(52, 211, 153, 0.15);
}
html[data-theme="dark"] .best-buy-trend.negative {
  background: rgba(248, 113, 113, 0.15);
}

/* ==========================================================================
   Local Market Prices (Gold & Fuel) Sections Styling
   ========================================================================== */
.local-market-section {
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

.local-market-header {
  margin-bottom: 1.5rem;
}

.local-market-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--primary) 0%, hsl(180, 70%, 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.local-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.commodity-card {
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.commodity-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .commodity-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.commodity-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.commodity-icon {
  font-size: 1.3rem;
}

.commodity-time-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.3rem 0 1.25rem;
}

.update-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

.commodity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.commodity-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.commodity-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

html[dir="rtl"] .commodity-table {
  text-align: right;
}

.commodity-table th {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid var(--border);
}

html[data-theme="dark"] .commodity-table th {
  background: rgba(255, 255, 255, 0.02);
}

.commodity-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
}

.commodity-table tr:last-child td {
  border-bottom: none;
}

/* Commodity Table Trend Indicators */
.commodity-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

html[dir="rtl"] .commodity-trend {
  margin-left: 0;
  margin-right: 0.5rem;
}

.commodity-trend.positive {
  color: #10b981;
}

.commodity-trend.negative {
  color: #ef4444;
}

html[data-theme="dark"] .commodity-trend.positive {
  color: #34d399;
}

html[data-theme="dark"] .commodity-trend.negative {
  color: #f87171;
}

.commodity-trend .trend-arrow {
  font-size: 0.65rem;
}

/* Responsive constraints */
@media (max-width: 480px) {
  .local-market-section {
    padding: 0 1rem;
  }
  .commodity-card {
    padding: 1.25rem 1rem;
  }
}

/* Dropdown Menu Styles */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 200px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  padding-top: 0.5rem;
  border-radius: 12px;
  z-index: 1001;
  box-shadow: var(--shadow);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu li a {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem !important;
  min-height: 44px;
  color: var(--text-main) !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-menu li a:hover {
  background: rgba(24, 80, 136, 0.1);
  color: var(--primary) !important;
}

.dropdown:hover .dropdown-menu,
.dropdown.dropdown-open .dropdown-menu {
  display: block;
}

/* RTL layout adjustment for dropdown placement */
html[dir="rtl"] .dropdown-menu {
  left: auto;
  right: 0;
}

.menu-bank-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  vertical-align: middle;
}

.scrollable-menu {
  max-height: 350px;
  overflow-y: auto;
}

/* Hamburger Toggle Button styles */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  background: rgba(24, 80, 136, 0.1);
}

/* Side Menu Overlay & Drawer Styles */
.side-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.side-menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.side-menu-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 300px;
  max-width: 80%;
  background: var(--side-menu-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

/* Slide in from right if RTL */
html[dir="rtl"] .side-menu-drawer {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
}

.side-menu-drawer.open {
  transform: translateX(0);
}

/* When open, ensure the layout slide aligns properly in LTR/RTL */
html[dir="rtl"] .side-menu-drawer.open {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.side-menu-close {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-menu-close:hover {
  background: rgba(24, 80, 136, 0.1);
}

.side-menu-nav {
  flex: 1;
  overflow-y: auto;
}

.side-menu-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side-menu-links > li > a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.side-menu-links > li > a:hover {
  color: var(--primary);
}

.side-menu-item-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.side-menu-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.side-menu-sublinks {
  list-style: none;
  padding: 0 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 2px solid var(--border);
}

html[dir="rtl"] .side-menu-sublinks {
  border-left: none;
  border-right: 2px solid var(--border);
}

.side-menu-sublinks li a {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  min-height: 44px;
  transition: var(--transition);
}

.side-menu-sublinks li a:hover {
  color: var(--primary);
}

.scrollable-sublinks {
  max-height: 200px;
  overflow-y: auto;
}

/* Hide desktop menu items on small screens and show hamburger */
@media (max-width: 992px) {
  .nav-links {
    display: none !important;
  }
  .menu-toggle {
    display: inline-flex;
  }
}

/* ============================================================================
   BANK PROFILE & INSTITUTIONAL TRUST STYLES (US1)
   ============================================================================ */
.bank-profile-card {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.bank-hotline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark, #0d5f47));
  color: #fff !important;
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-radius: 100px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bank-hotline-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.bank-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.bank-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .bank-meta-item {
  background: rgba(255, 255, 255, 0.03);
}

.bank-meta-item:hover {
  border-color: var(--primary);
}

/* ============================================================================
   RATE FRESHNESS BADGE & PULSE ANIMATION (US2)
   ============================================================================ */
.rate-freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(var(--primary-rgb, 16, 185, 129), 0.08);
  border: 1px solid rgba(var(--primary-rgb, 16, 185, 129), 0.25);
  color: var(--text-main);
  font-size: 0.85rem;
  border-radius: 100px;
  padding: 0.45rem 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.rate-freshness-badge.status-stable {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ============================================================================
   HISTORICAL RATES STYLES (US3)
   ============================================================================ */
.bank-history-panel {
  border-radius: 16px;
}

.horizon-btn {
  transition: all 0.2s ease;
  font-family: inherit;
}

.horizon-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .horizon-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

.history-currency-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
}

.history-currency-tab:hover:not(.active) {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 16, 185, 129), 0.06);
}

/* ============================================================================
   STOCKS DASHBOARD STYLES (US4 & US5)
   ============================================================================ */
.stocks-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

.index-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.index-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.market-status-badge {
  transition: all 0.2s ease;
}

.market-status-badge.status-open {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.market-status-badge.status-closed {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

.stocks-table tbody tr:hover {
  background: rgba(var(--primary-rgb, 16, 185, 129), 0.04);
}

.stock-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .stock-logo-img {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.stocks-table tbody tr:hover .stock-logo-img {
  transform: scale(1.08);
}

.stock-index-toggle-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

[data-theme="dark"] .stock-index-toggle-wrapper {
  background: rgba(255, 255, 255, 0.05);
}

.stock-index-toggle-wrapper .horizon-btn {
  padding: 0.55rem 1.25rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.stock-index-toggle-wrapper .horizon-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 16, 185, 129), 0.3);
}

/* Responsive adjustments for stocks & bank profile */
@media (max-width: 768px) {
  .stocks-header-panel {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .stock-index-toggle-wrapper {
    width: 100%;
    justify-content: center;
  }
  .stock-index-toggle-wrapper .horizon-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  .bank-meta-grid {
    grid-template-columns: 1fr;
  }
  .timeframe-toggle {
    width: 100%;
    justify-content: center;
  }
}




