/* SP-Today Clone - Ultra Modern Premium Design */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
  --font-primary: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;

  /* Light Mode Colors */
  --color-bg: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-surface: rgba(255, 255, 255, 0.05);
  --color-surface-hover: rgba(255, 255, 255, 0.08);

  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-accent-glow: rgba(59, 130, 246, 0.3);

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-success-glow: rgba(16, 185, 129, 0.3);

  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-danger-glow: rgba(239, 68, 68, 0.3);

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);

  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-gold: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--color-accent-glow);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --blur-sm: blur(8px);
  --blur-md: blur(12px);
  --blur-lg: blur(16px);
}

/* Light Mode */
body.light-mode {
  --color-bg: #f8fafc;
  --color-bg-secondary: #f1f5f9;
  --color-surface: rgba(255, 255, 255, 0.9);
  --color-surface-hover: rgba(255, 255, 255, 1);

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.3s ease;
}

body.light-mode header {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
  letter-spacing: -0.5px;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--color-accent-glow));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  transition: all 0.3s ease;
  backdrop-filter: var(--blur-sm);
}

.theme-toggle:hover {
  background: var(--color-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Ticker */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: var(--blur-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0;
  position: relative;
}

body.light-mode .ticker-wrap {
  background: rgba(241, 245, 249, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  padding-right: 100%;
}

.ticker:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-block;
  padding: 0 2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.ticker-item .font-bold {
  font-weight: 700;
  margin-left: 0.25rem;
  color: var(--color-accent);
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* Hero */
.hero {
  padding: 4rem 0 6rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  animation: fadeInUp 0.8s ease;
}

body.light-mode .hero h1 {
  background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Featured Grid */
.grid-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: -3rem;
  position: relative;
  z-index: 10;
}

/* Cards */
.card {
  background: var(--color-surface);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease backwards;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  border-color: rgba(59, 130, 246, 0.3);
}

body.light-mode .card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.currency-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.currency-flag {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.currency-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .price-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.price-label {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.price-value {
  font-weight: 700;
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.trend-up {
  background: var(--color-success-bg);
  color: var(--color-success);
  box-shadow: 0 0 15px var(--color-success-glow);
}

.trend-down {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  box-shadow: 0 0 15px var(--color-danger-glow);
}

.trend-stable {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-secondary);
}

/* Main Content */
main {
  padding: 3rem 0;
}

.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  position: relative;
  padding-right: 1.25rem;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  width: 5px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px var(--color-accent-glow);
}

/* Table */
.table-container {
  background: var(--color-surface);
  backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

body.light-mode .table-container {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1.25rem 1.5rem;
  text-align: right;
}

th {
  background: rgba(59, 130, 246, 0.1);
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

body.light-mode th {
  background: rgba(59, 130, 246, 0.05);
}

tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

body.light-mode tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

tr:last-child {
  border-bottom: none;
}

tr:hover {
  background: rgba(59, 130, 246, 0.05);
  transform: scale(1.01);
}

td {
  color: var(--color-text-primary);
}

.font-mono {
  font-family: 'Courier New', monospace;
  letter-spacing: -0.5px;
}

.font-bold {
  font-weight: 700;
}

/* Fuel Cards */
.grid-fuel {
  display: grid;
  gap: 1rem;
}

.fuel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

body.light-mode .fuel-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.fuel-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fuel-card:hover::before {
  opacity: 1;
}

.fuel-card:hover {
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Footer */
.footer {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: var(--blur-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
  text-align: center;
  position: relative;
}

body.light-mode .footer {
  background: rgba(241, 245, 249, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer p {
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .main-content {
    grid-template-columns: 1fr;
  }

  .grid-featured {
    grid-template-columns: 1fr;
    margin-top: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* Utility Classes */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  background-size: 1000px 100%;
}