/* ============================================
   🧩 Shared Styles – Header, Footer, Cards, Toasts
   ============================================ */

:root {
  --bg-dark: #0b0e1a;
  --bg-card: #141b2b;
  --text-primary: #e0e6f0;
  --text-secondary: #8892a8;
  --accent: #6c8cff;
  --border: #1e2a3a;
  --green: #4caf50;
  --red: #f44336;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  padding: 1rem;
  min-height: 100vh;
}

/* ---------- Layout ---------- */
.app-wrapper {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---------- Toast ---------- */
.toast-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2ecc71;
  color: #fff;
  padding: 20px 40px;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: var(--shadow);
  z-index: 9999;
  text-align: center;
  min-width: 250px;
  animation: fadeIn 0.3s ease;
  transition: opacity 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---------- Header ---------- */
.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  font-size: 1.8rem;
}
.logo-text {
  font-size: 1.4rem;
  font-weight: 600;
}
.logo-text .accent {
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-link:hover,
.nav-link.active {
  background: var(--border);
  color: var(--text-primary);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.user-email {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
}
.btn-logout:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.live {
  background: var(--green);
}
.status-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 1rem;
}
.footer-ad {
  margin-bottom: 1rem;
}
.ad-footer {
  min-height: 100px;
  padding: 0.5rem;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* ---------- Ad Sidebars ---------- */
.ad-sidebar {
  width: 160px;
  flex-shrink: 0;
}
.ad-sidebar-left {
  margin-right: 1.5rem;
}
.ad-sidebar-right {
  margin-left: 1.5rem;
}
.ad-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ad-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.ad-placeholder {
  color: var(--text-secondary);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.badge {
  background: var(--border);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ---------- Buttons ---------- */
.btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}
.btn:hover {
  opacity: 0.8;
}
.btn.buy {
  background: var(--green);
}
.btn.sell {
  background: var(--red);
}
.btn.reset {
  background: var(--text-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ad-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0.5rem;
  }
  .app-header {
    padding: 0.5rem 1rem;
  }
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .main-nav {
    justify-content: center;
  }
  .header-status {
    justify-content: center;
  }
  .logo {
    justify-content: center;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .toast-notification {
    min-width: 200px;
    padding: 15px 25px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 1.2rem;
  }
  .main-nav {
    gap: 0.8rem;
  }
  .nav-link {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }
  .user-email {
    max-width: 100px;
    font-size: 0.75rem;
  }
  .card {
    padding: 0.8rem;
  }
  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}