/* ==========================================================================
   BREAKING BAD & BETTER CALL SAUL ENTERPRISE PRODUCTION DESIGN SYSTEM
   Theme: Smoked Obsidian Dark (#080A0E), Breaking Bad Emerald (#00E676),
          Crystal Cyan (#00E5FF), Albuquerque Gold (#D4AF37)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@500;700;800&family=Special+Elite&display=swap');

:root {
  --bg-dark: #080A0E;
  --bg-panel: rgba(14, 18, 24, 0.94);
  --bg-card: rgba(18, 24, 34, 0.96);
  
  --emerald-green: #00E676;
  --emerald-dark: #004D25;
  --emerald-glow: rgba(0, 230, 118, 0.35);
  
  --crystal-cyan: #00E5FF;
  --crystal-cyan-glow: rgba(0, 229, 255, 0.35);
  
  --gold-accent: #D4AF37;
  --gold-glow: rgba(212, 175, 55, 0.4);
  
  --smoke-border: rgba(0, 230, 118, 0.25);
  --smoke-border-hover: rgba(0, 229, 255, 0.5);
  
  --text-primary: #FFFFFF;
  --text-muted: #94A3B8;
  
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-typewriter: 'Special Elite', cursive, monospace;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 230, 118, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #080A0E 0%, #030406 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
}

/* ==========================================================================
   HEADER LOGO & TOP NAV (FIT ALL LAPTOPS & DESKTOPS)
   ========================================================================== */

.app-navbar {
  background: rgba(8, 10, 14, 0.97);
  backdrop-filter: blur(18px);
  border-bottom: 2px solid var(--emerald-green);
  box-shadow: 0 4px 25px rgba(0, 230, 118, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 8px 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.nav-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 1;
  min-width: 0;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px var(--emerald-glow));
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-title span.highlight {
  color: var(--emerald-green);
  text-shadow: 0 0 12px var(--emerald-glow);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: nowrap;
  flex-shrink: 1;
}

.nav-link {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-block;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--emerald-green);
  background: rgba(0, 230, 118, 0.08);
  border-color: var(--smoke-border);
}

.nav-link.active {
  color: var(--emerald-green);
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--emerald-green);
  box-shadow: 0 0 14px var(--emerald-glow);
}

.user-status-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(14,18,24,0.9);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--smoke-border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  flex-shrink: 1;
}

#user-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid #EF4444;
  color: #EF4444;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: #EF4444;
  color: #FFF;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   AUTHENTIC BREAKING BAD PERIODIC TABLE BADGES
   ========================================================================== */

.bb-periodic-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #004D25 0%, #002D15 100%);
  border: 1.5px solid var(--emerald-green);
  box-shadow: 0 0 10px var(--emerald-glow);
  color: #FFFFFF;
  font-family: var(--font-mono);
  width: 34px;
  height: 34px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
  flex-shrink: 0;
}

.bb-periodic-badge .num {
  font-size: 0.45rem;
  opacity: 0.9;
  font-weight: 700;
}

.bb-periodic-badge .sym {
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  align-self: center;
  font-family: 'Inter', sans-serif;
}

.bb-periodic-badge .mass {
  font-size: 0.34rem;
  opacity: 0.75;
}

/* ==========================================================================
   CINEMATIC HERO BANNERS
   ========================================================================== */

.bb-hero-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--smoke-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin-bottom: 20px;
}

.bb-hero-banner img.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.7) contrast(1.1);
}

.bb-hero-banner .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.2) 0%, rgba(8, 10, 14, 0.95) 100%),
              radial-gradient(circle at 20% 50%, rgba(0, 230, 118, 0.12) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 22px;
}

.hero-quote-text {
  font-family: var(--font-typewriter);
  font-size: 1.2rem;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  max-width: 900px;
  line-height: 1.3;
  margin-bottom: 5px;
}

.hero-quote-speaker {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 1.5px;
  color: var(--emerald-green);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--emerald-glow);
}

/* ==========================================================================
   MAIN CONTENT & CARDS
   ========================================================================== */

.main-content {
  max-width: 1400px;
  margin: 18px auto;
  padding: 0 16px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.tab-pane {
  display: none;
  width: 100%;
  max-width: 100%;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 100%;
}

.glass-card {
  background: var(--bg-card);
  border: 1.5px solid var(--smoke-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.25s ease;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--smoke-border-hover);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.25;
}

/* ==========================================================================
   FORMS & BUTTONS
   ========================================================================== */

.form-group {
  margin-bottom: 14px;
  width: 100%;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  max-width: 100%;
  background: rgba(8, 10, 14, 0.95);
  border: 1.5px solid var(--smoke-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all 0.25s ease;
  text-overflow: ellipsis;
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald-green);
  box-shadow: 0 0 14px var(--emerald-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%3c00E676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 28px;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #00E676 0%, #00A859 100%);
  color: var(--bg-dark);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 1.5px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px var(--emerald-glow);
  min-height: 42px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #33E88E 0%, #00E676 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.5);
}

/* ==========================================================================
   LEADERBOARD & TABLE ROWS
   ========================================================================== */

.leaderboard-row {
  background: rgba(14, 18, 24, 0.9);
  border: 1.5px solid var(--smoke-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.25s ease;
  width: 100%;
}

.leaderboard-row:hover {
  border-color: var(--crystal-cyan);
  box-shadow: 0 4px 20px var(--crystal-cyan-glow);
}

.leaderboard-row.rank-1 {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(14, 18, 24, 0.95) 100%);
  border: 2px solid var(--emerald-green);
  box-shadow: 0 0 24px var(--emerald-glow);
}

.rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--smoke-border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.rank-1 .rank-badge {
  background: var(--gold-accent);
  color: var(--bg-dark);
  border-color: var(--gold-accent);
  box-shadow: 0 0 16px var(--gold-glow);
}

.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pending { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border: 1px solid #F59E0B; }
.status-processing { background: rgba(59, 130, 246, 0.15); color: #3B82F6; border: 1px solid #3B82F6; }
.status-finished { background: rgba(0, 230, 118, 0.15); color: var(--emerald-green); border: 1px solid var(--emerald-green); box-shadow: 0 0 10px var(--emerald-glow); }

/* ==========================================================================
   TOAST NOTIFICATION ENGINE
   ========================================================================== */

#toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(8, 10, 14, 0.96);
  border: 1.5px solid var(--emerald-green);
  box-shadow: 0 8px 25px var(--emerald-glow);
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (MOBILE STACKING <= 960px)
   ========================================================================== */

@media (max-width: 960px) {
  .app-navbar {
    padding: 8px 12px;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nav-top-row {
    width: 100%;
    justify-content: space-between;
  }

  .nav-menu {
    width: 100%;
    overflow-x: auto;
    padding: 4px 0 2px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.72rem;
    padding: 5px 8px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-logo-img {
    height: 28px;
  }

  .user-status-pill {
    max-width: 140px;
    font-size: 0.68rem;
    padding: 3px 6px;
  }

  .main-content {
    margin: 12px auto;
    padding: 0 10px;
  }

  .bb-hero-banner {
    height: 160px;
    margin-bottom: 14px;
  }

  .bb-hero-banner .hero-overlay {
    padding: 12px;
  }

  .hero-quote-text {
    font-size: 0.85rem;
    line-height: 1.25;
  }

  .hero-quote-speaker {
    font-size: 0.72rem;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .glass-card {
    padding: 14px 10px;
  }

  .card-title {
    font-size: 1.1rem;
    gap: 8px;
  }

  .leaderboard-row {
    padding: 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  #toast-container {
    top: 110px;
    right: 10px;
    left: 10px;
  }
}

/* ==========================================================================
   B2B & B2C DUAL PORTAL MODULE STYLES
   ========================================================================== */

.portal-switch-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: rgba(14, 18, 24, 0.95);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--smoke-border);
}

.portal-tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.portal-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.portal-tab-btn.active-b2b {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2) 0%, rgba(0, 77, 37, 0.4) 100%);
  border-color: var(--emerald-green);
  color: var(--emerald-green);
  box-shadow: 0 0 16px var(--emerald-glow);
}

.portal-tab-btn.active-b2c {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(100, 75, 10, 0.4) 100%);
  border-color: var(--gold-accent);
  color: var(--gold-accent);
  box-shadow: 0 0 16px var(--gold-glow);
}

.admin-module-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-module-btn {
  flex: 1;
  padding: 14px 20px;
  background: rgba(14, 18, 24, 0.95);
  border: 1.5px solid var(--smoke-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.admin-module-btn.active-b2b {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2) 0%, rgba(18, 24, 34, 0.95) 100%);
  border-color: var(--emerald-green);
  color: var(--emerald-green);
  box-shadow: 0 0 18px var(--emerald-glow);
}

.admin-module-btn.active-b2c {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(18, 24, 34, 0.95) 100%);
  border-color: var(--crystal-cyan);
  color: var(--crystal-cyan);
  box-shadow: 0 0 18px var(--crystal-cyan-glow);
}

.badge-b2b {
  background: linear-gradient(135deg, #004D25 0%, #002D15 100%);
  border-color: var(--emerald-green);
}

.badge-b2c {
  background: linear-gradient(135deg, #5A4300 0%, #2D2100 100%);
  border-color: var(--gold-accent);
  box-shadow: 0 0 10px var(--gold-glow);
}

