/* EggTrader.com — Main Stylesheet */

:root {
  --primary:       #1a6b3c;
  --primary-dark:  #134f2c;
  --primary-light: #e8f5ee;
  --accent:        #f5a623;
  --accent-dark:   #d4891a;
  --text-main:     #1a1a2e;
  --text-muted:    #6c757d;
  --border:        #e2e8f0;
  --surface:       #f8fafc;
  --white:         #ffffff;
  --success:       #22c55e;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background: #f0f4f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Ticker Bar ─────────────────────────────────────────────── */
.ticker-bar {
  background: var(--primary-dark);
  color: #fff;
  display: flex;
  align-items: center;
  height: 32px;
  overflow: hidden;
  font-size: .75rem;
}
.ticker-label {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .7rem;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-content {
  display: flex;
  gap: 0;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  border-right: 1px solid rgba(255,255,255,.15);
}
.ticker-price { color: var(--accent); font-weight: 600; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Spot Market: live-dot pulse animation ───────────────────── */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: livePulse 1.2s ease-in-out infinite;
  vertical-align: middle;
  margin-bottom: 1px;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .35; transform: scale(.65); }
}

/* ── Navbar ─────────────────────────────────────────────────── */
.bg-primary-dark { background: var(--primary-dark) !important; }

.brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}
.brand-icon-lg { width: 44px; height: 44px; font-size: 1.4rem; }
.brand-name { font-weight: 800; font-size: 1.15rem; color: #fff; line-height: 1.1; }
.brand-sub  { font-size: .65rem; color: rgba(255,255,255,.6); line-height: 1; }

.search-bar { border-radius: 8px; overflow: hidden; }
.search-cat {
  max-width: 120px;
  border-right: none;
  border-radius: 0;
  background: #fff;
  color: var(--text-main);
  font-size: .85rem;
  border-color: transparent;
}
.search-bar .form-control {
  border-left: 1px solid var(--border);
  border-right: none;
  font-size: .9rem;
  background: #fff;
  color: var(--text-main);
}
.search-bar .form-control:focus { box-shadow: none; border-color: var(--accent); }
.search-bar .btn-warning { border-radius: 0; padding: 0 16px; font-size: 1rem; }

.navbar-nav .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; padding: .5rem .75rem; border-radius: 6px; transition: all .2s; }
.navbar-nav .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.1); }

.avatar-sm {
  width: 30px; height: 30px;
  background: var(--accent);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}

.notif-dropdown { max-height: 380px; overflow-y: auto; }
.notif-dropdown .dropdown-item { white-space: normal; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: 8px; transition: all .2s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-warning { background: var(--accent); border-color: var(--accent); color: #000; }
.btn-warning:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--border); }

/* ── Product Card ─────────────────────────────────────────────── */
.product-card { border: none; border-radius: var(--radius); overflow: hidden; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-thumb {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--primary-light), #d4edda);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: var(--primary);
  position: relative; overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent); color: #000;
  font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .05em;
}
.product-card .card-body { padding: 14px; }
.product-card .card-title { font-size: .9rem; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.product-price { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.product-price .per-unit { font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.product-meta { font-size: .78rem; color: var(--text-muted); }

.market-linked-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .65rem; background: #e8f5ee; color: var(--primary);
  border: 1px solid #b8dfc8; border-radius: 10px; padding: 1px 6px;
  font-weight: 600;
}

/* ── Price Index ─────────────────────────────────────────────── */
.price-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow);
}
.price-card .price-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 16px 20px;
}
.price-card .price-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.price-change-up   { color: #22c55e; }
.price-change-down { color: #ef4444; }

/* ── Hero Section ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0f3d22 60%, #1a6b3c 100%);
  color: #fff;
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-title { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.2; }
.hero-subtitle { font-size: 1.1rem; opacity: .85; margin-bottom: 2rem; }
.hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap;
  margin-top: 2.5rem;
}
.hero-stat { text-align: center; }
.hero-stat .value { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.hero-stat .label { font-size: .75rem; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }

/* Price spotlight card */
.price-spotlight {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 20px;
}
.price-spotlight .district-price {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: .9rem;
}
.price-spotlight .district-price:last-child { border-bottom: none; }
.price-spotlight .rate { font-weight: 700; color: var(--accent); }

/* ── Category Strip ───────────────────────────────────────────── */
.category-strip { padding: 32px 0; background: var(--white); }
.cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-main);
  transition: all .2s;
  background: var(--white);
  cursor: pointer;
  font-size: .85rem; font-weight: 600;
}
.cat-pill:hover, .cat-pill.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}
.cat-pill .icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--primary);
}
.cat-pill:hover .icon, .cat-pill.active .icon { background: var(--primary); color: #fff; }

/* ── Section Headers ──────────────────────────────────────────── */
.section-header { margin-bottom: 28px; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.section-subtitle { color: var(--text-muted); font-size: .9rem; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius);
  padding: 20px;
  border: none;
  box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .75; text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: rgba(255,255,255,.2);
}

/* ── Table ───────────────────────────────────────────────────── */
.table { font-size: .88rem; }
.table th { font-weight: 600; white-space: nowrap; background: var(--surface); color: var(--text-muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--border);
  font-size: .9rem;
  padding: .5rem .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,.12);
}
.form-label { font-weight: 500; font-size: .88rem; margin-bottom: .35rem; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - 110px);
  display: flex; align-items: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 60%);
  padding: 40px 0;
}
.auth-card {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: none;
}
.auth-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: center;
  padding: 32px 24px 24px;
  border-radius: 16px 16px 0 0;
}
.role-tab {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.role-tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  font-size: .8rem; font-weight: 600; color: var(--text-muted);
}
.role-tab-item:hover, .role-tab-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.role-tab-item i { font-size: 1.4rem; }

/* ── Dashboard Sidebar ───────────────────────────────────────── */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 120px);
  padding: 20px 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--text-main);
  text-decoration: none;
  font-size: .88rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}
.sidebar-link i { font-size: 1rem; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer { background: #0d2b1a; }
.footer-top { padding: 56px 0 40px; }
.footer-bottom { padding: 16px 0; border-top: 1px solid rgba(255,255,255,.07); }
.footer-heading { color: var(--accent); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.text-muted-light { color: rgba(255,255,255,.55); }
.social-icon {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: all .2s;
  font-size: .9rem;
}
.social-icon:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.app-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff; text-decoration: none;
  font-size: .85rem;
  transition: all .2s;
}
.app-btn:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }

/* ── Trust Badges ────────────────────────────────────────────── */
.trust-bar { background: var(--surface); padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-item { display: flex; align-items: center; gap: 10px; }
.trust-item i { font-size: 1.5rem; color: var(--primary); }
.trust-item .title { font-weight: 600; font-size: .88rem; }
.trust-item .sub { font-size: .75rem; color: var(--text-muted); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-weight: 600; border-radius: 6px; }

/* ── Misc helpers ────────────────────────────────────────────── */
.rounded-pill { border-radius: 50px !important; }
.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.bg-accent    { background: var(--accent) !important; color: #000; }
.bg-surface   { background: var(--surface); }
.border-bottom-dashed { border-bottom: 1px dashed var(--border); }
.fw-800 { font-weight: 800; }

/* ── Chart wrapper ───────────────────────────────────────────── */
.chart-wrapper { position: relative; height: 220px; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3.5rem; opacity: .3; margin-bottom: 16px; }
.empty-state h5 { font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .hero { padding: 48px 0 36px; }
  .hero-stats { gap: 20px; }
  .category-strip { padding: 20px 0; }
  .cat-pill { padding: 12px; font-size: .75rem; }
  .cat-pill .icon { width: 36px; height: 36px; font-size: 1rem; }
}
