@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-color: #0b0f19;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --card-bg: rgba(30, 41, 59, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --up-color: #10b981;
  --down-color: #ef4444;
}

body.theme-light {
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(0, 0, 0, 0.06);
  --accent-color: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --up-color: #059669;
  --down-color: #dc2626;
}

/* Light mode specific overrides */
.theme-light .logo-text {
  background: linear-gradient(135deg, #000 0%, #475569 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-light .logo-text span {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.theme-light .category-card {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

.theme-light .category-card:hover {
  box-shadow: 0 15px 35px rgba(0,0,0,0.08), 0 0 20px rgba(59, 130, 246, 0.15);
}

.theme-light .card-header {
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.theme-light .price-item {
  background: rgba(0,0,0,0.03);
}

.theme-light .price-item:hover {
  background: rgba(0,0,0,0.06);
}

.theme-light .item-name {
  color: #1e293b;
}

.theme-light .spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-left-color: var(--accent-color);
}

.theme-light .footer {
  border-top: 1px solid rgba(0,0,0,0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

/* Background elements for rich aesthetic */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s infinite linear alternate;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.6) 0%, rgba(30,58,138,0) 70%);
  top: -100px;
  left: -100px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.4) 0%, rgba(6,78,59,0) 70%);
  bottom: -200px;
  right: -100px;
  animation-delay: -5s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, rgba(131,24,67,0) 70%);
  top: 40%;
  left: 60%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 80px) scale(0.9); }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease-out;
  position: relative;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.header-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-ctrl:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  border-color: var(--accent-color);
}

.btn-ctrl.spinning svg {
  animation: spin 0.8s linear infinite;
}

.btn-ctrl svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-text {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  color: var(--accent-color);
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 500;
}

.sync-bar {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up-color);
  box-shadow: 0 0 8px var(--up-color);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Loader */
.loader-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 40vh;
  gap: 1.5rem;
  color: var(--text-muted);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Grid layout */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
  padding: 0.5rem;
}

/* Glassmorphism Cards */
.category-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeInUp 0.6s ease-out both;
  overflow: hidden;
  position: relative;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.35), 0 0 20px rgba(59, 130, 246, 0.15);
  border-color: rgba(255, 255, 255, 0.15);
}

.category-card:hover::before {
  left: 150%;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  font-size: 1.75rem;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.card-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 2.5rem;
  font-variant-numeric: tabular-nums;
}

/* Items List */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
  transition: background 0.2s, transform 0.2s;
}

.price-item:hover {
  background: rgba(255,255,255,0.07);
}

.item-name {
  font-weight: 500;
  font-size: 1rem;
  color: #e2e8f0;
  flex: 1;
  line-height: 1.35;
}

.item-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
  max-width: 60%;
  text-align: right;
}

.item-price {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.item-change {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.change-up {
  color: var(--up-color);
  background: rgba(16,185,129,0.12);
}

.change-down {
  color: var(--down-color);
  background: rgba(239,68,68,0.12);
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 3.5rem;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  line-height: 1.6;
}

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 768px) {
  .logo-text { font-size: 2.3rem; }
  .logo-icon { font-size: 1.8rem; }
  .subtitle { font-size: 0.9rem; }
  .header-controls { position: static; justify-content: center; margin-top: 1rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .category-card { padding: 1.4rem; }
}
