/* Header component styles */

/* Enhanced topbar with investment info */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-radius:16px;
  margin-bottom:16px;
  gap:20px;
  flex-wrap:nowrap;
  overflow:visible; /* ADDED: Allow dropdown to show */
  position:relative;
  z-index:100; /* ADDED: Lower than dropdown */
}

.tb-left{
  display:flex;
  align-items:center;
  gap:20px;
  flex:1;
  min-width:0;
}

.tb-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
}

/* Brand styling */
.brand-mini{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  text-decoration:none;
  font-weight:700;
  letter-spacing:.3px;
  flex-shrink:0;
}

.brand-mini img{
  width:24px;
  height:24px;
}

/* Info link with subtle glow */
.info-link{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 16px;
  border-radius:20px;
  font-size:13px;
  font-weight:600;
  color:var(--text);
  text-decoration:none;
  background:linear-gradient(135deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  border:1px solid rgba(255,255,255,0.15);
  transition:all .3s ease;
  letter-spacing:.2px;
  position:relative;
  overflow:hidden;
  backdrop-filter:blur(8px);
  box-shadow:0 0 12px rgba(255,255,255,0.15), 0 4px 15px rgba(0,0,0,0.2);
  flex-shrink:0;
}

.info-link::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform:translateX(-100%);
  transition:transform .6s ease;
}

.info-link:hover::before{
  transform:translateX(100%);
}

.info-link:hover{
  background:linear-gradient(135deg,rgba(255,255,255,0.12),rgba(255,255,255,0.06));
  border-color:rgba(255,255,255,0.25);
  transform:translateY(-1px);
  color:#ffffff;
  box-shadow:0 0 18px rgba(255,255,255,0.25), 0 6px 20px rgba(0,0,0,0.3);
}

/* Investment bubbles */
.investment-bubbles{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
  flex-shrink:0;
}

.investment-bubble{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 16px;
  border-radius:20px;
  background:linear-gradient(135deg,rgba(0,255,162,0.15),rgba(0,194,255,0.12));
  border:1px solid rgba(0,255,162,0.3);
  font-size:13px;
  font-weight:700;
  letter-spacing:.3px;
  transition:all .3s ease;
  position:relative;
  overflow:hidden;
  white-space:nowrap;
}

.investment-bubble::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform:translateX(-100%);
  transition:transform .6s ease;
}

.investment-bubble:hover::before{
  transform:translateX(100%);
}

.investment-bubble:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 20px rgba(0,255,162,0.2);
  border-color:rgba(0,255,162,0.5);
}

.bubble-icon{
  font-size:16px;
  filter:drop-shadow(0 0 4px currentColor);
  flex-shrink:0;
}

.bubble-text{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  min-width:0;
}

.bubble-label{
  font-size:10px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  white-space:nowrap;
}

.bubble-amount{
  font-size:14px;
  color:var(--accent);
  font-weight:800;
  white-space:nowrap;
}

.available-bubble{
  background:linear-gradient(135deg,rgba(255,165,0,0.15),rgba(255,140,0,0.12));
  border-color:rgba(255,165,0,0.3);
}

.available-bubble .bubble-amount{
  color:#ffa500;
}

/* Profile Dropdown - FIXED */
.profile-dropdown{
  position:relative;
  z-index:999; /* CHANGED: Reduced from 9999 */
  flex-shrink:0;
}

.profile-trigger{
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  padding:8px 12px;
  color:var(--text);
  cursor:pointer;
  transition:all .2s ease;
  display:flex;
  align-items:center;
  min-width:200px;
  position:relative;
  z-index:999; /* CHANGED: Reduced from 9999 */
}

.profile-trigger:hover{
  background:rgba(255,255,255,0.08);
  border-color:rgba(255,255,255,0.2);
}

.profile-info{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
}

.profile-avatar{
  font-size:20px;
  width:32px;
  height:32px;
  border-radius:50%;
  background:rgba(0,255,162,0.1);
  border:1px solid rgba(0,255,162,0.3);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.profile-details{
  flex:1;
  text-align:left;
  min-width:0;
}

.profile-name{
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.profile-status{
  font-size:11px;
  color:var(--accent);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.3px;
  white-space:nowrap;
}

.dropdown-arrow{
  font-size:10px;
  opacity:.7;
  transition:transform .2s ease;
  flex-shrink:0;
}

.profile-dropdown.active .dropdown-arrow{
  transform:rotate(180deg);
}

.profile-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  background:
    linear-gradient(180deg, rgba(11,15,20,0.95), rgba(11,15,20,0.98)),
    linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  backdrop-filter:blur(20px) saturate(120%);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  box-shadow:var(--shadow), 0 0 0 1px rgba(11,15,20,0.8);
  min-width:250px;
  opacity:0;
  visibility:hidden;
  transform:translateY(-10px);
  transition:all .3s ease;
  z-index:1000; /* CHANGED: Reduced from 10000 */
  max-height:300px;
  overflow-y:auto;
  max-width:90vw; /* ADDED: Prevent overflow */
  box-sizing:border-box; /* ADDED: Proper box model */
}

.profile-dropdown.active .profile-menu{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.character-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,0.06);
  cursor:pointer;
  transition:all .2s ease;
}

.character-item:last-child{
  border-bottom:none;
}

.character-item:hover{
  background:rgba(255,255,255,0.05);
}

.character-item.selected{
  background:rgba(0,255,162,0.08);
  border-left:3px solid var(--accent);
}

.character-item.selected:hover{
  background:rgba(0,255,162,0.12);
}

.char-avatar{
  font-size:18px;
  width:36px;
  height:36px;
  border-radius:50%;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.12);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.character-item.selected .char-avatar{
  background:rgba(0,255,162,0.1);
  border-color:rgba(0,255,162,0.3);
}

.char-info{
  flex:1;
  min-width:0;
}

.char-name{
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  margin-bottom:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.char-money{
  font-size:12px;
  color:var(--muted);
  margin-bottom:2px;
  white-space:nowrap;
}

.char-status{
  font-size:11px;
  color:var(--accent);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.2px;
  white-space:nowrap;
}

/* Responsive design for header */
@media (max-width: 1200px) {
  .investment-bubbles{
    gap:8px;
  }
  
  .investment-bubble{
    padding:6px 12px;
    font-size:12px;
  }
  
  .bubble-amount{
    font-size:13px;
  }
}

@media (max-width: 900px) {
  .topbar{
    gap:16px;
  }
  
  .tb-left{
    gap:16px;
  }
  
  .info-link{
    font-size:12px;
    padding:6px 12px;
    gap:6px;
  }
}

/* SIMPLE MOBILE APPROACH - NO MORE BULLSHIT */
@media (max-width: 768px) {
  .topbar{
    display:block !important;
    padding:12px;
  }
  
  /* Force everything into separate rows */
  .tb-left, .tb-right{
    display:block !important;
    width:100% !important;
    margin:0 !important;
  }
  
  /* Row 1: Brand */
  .brand-mini{
    display:block !important;
    margin-bottom:8px;
    text-align:left;
  }
  
  /* Row 2: Profile */
  .profile-dropdown{
    margin-bottom:8px;
  }
  
  .profile-trigger{
    width:100% !important;
    max-width:none !important;
    min-width:auto !important;
    padding:8px 12px;
    display:flex;
    justify-content:space-between;
  }
  
  /* Row 3: Investment bubbles */
  .investment-bubbles{
    display:flex !important;
    width:100% !important;
    margin:0 0 8px 0 !important;
    gap:8px;
    position:static !important;
  }
  
  .investment-bubble{
    flex:1 !important;
    margin:0 !important;
    max-width:calc(50% - 4px) !important;
    min-width:0 !important;
    padding:6px 8px;
    font-size:11px;
    overflow:hidden;
  }
  
  .bubble-amount{
    font-size:12px;
  }
  
  .bubble-label{
    font-size:9px;
  }
  
  /* Row 4: Info link */
  .info-link{
    display:block !important;
    width:fit-content;
    margin:0 auto;
    font-size:12px;
    padding:6px 12px;
  }
}

/* Phone - stack bubbles */
@media (max-width: 480px) {
  .investment-bubbles{
    flex-direction:column !important;
    gap:6px !important;
  }
  
  .investment-bubble{
    max-width:none !important;
    width:100% !important;
    padding:8px 12px;
    text-align:center;
  }
  
  .bubble-amount{
    font-size:14px;
  }
}

@media (max-width: 480px) {
  .investment-bubbles{
    flex-direction:column;
    gap:8px;
  }
  
  .investment-bubble{
    padding:6px 12px;
    font-size:12px;
    justify-content:center;
  }
  
  .profile-trigger{
    min-width:180px;
  }
}