:root {
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #facc15;
  --bg-dark: #0f172a;
  --bg-medium: #1e293b;
  --bg-light: #334155;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: url('https://images.unsplash.com/photo-1611974789855-9c2a0a7236a3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-light);
  overflow-x: hidden;
  min-height: 100vh;
}

.glass {
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.75);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px;
  color: var(--text-light);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 2.5rem;
}

h2 {
  color: var(--primary);
  margin-top: 0;
  font-size: 1.5rem;
}

#loading {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

select, input {
  background: var(--bg-medium);
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  color: white;
  min-width: 150px;
}

input::placeholder {
  color: var(--text-muted);
}

.search-container {
  display: flex;
  gap: 10px;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.market-overview {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.market-card {
  padding: 15px 20px;
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.7);
  min-width: 150px;
  text-align: center;
}

.market-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.market-card .value {
  font-size: 1.2rem;
  font-weight: bold;
}

.trader-list, .stock-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.trader-card, .stock-card {
  padding: 20px;
  border-radius: 16px;
  background: rgba(51, 65, 85, 0.8);
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.05);
}

.trader-card:hover, .stock-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.trader-name, .stock-name {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.price {
  font-size: 24px;
  font-weight: bold;
  margin: 10px 0;
}

.change {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
}

.green {
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
}

.red {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

.badge {
  background: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  margin-left: 8px;
}

.country-badge {
  background: rgba(56, 189, 248, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--primary);
  margin-left: 8px;
}

.stock-details {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Chatbot Styles */
#chatbot {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  max-height: 500px;
}

#chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s;
}

#chat-toggle:hover {
  transform: scale(1.1);
}

#chat-header {
  padding: 15px;
  font-weight: bold;
  color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.status-indicator {
  font-size: 10px;
  margin-left: 5px;
}

.online {
  color: var(--success);
}

.offline {
  color: var(--danger);
}

#close-chat {
  cursor: pointer;
  color: var(--danger);
  font-size: 18px;
}

#chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  font-size: 14px;
  color: var(--text-light);
  flex-grow: 1;
}

#chat-messages .bot {
  margin-bottom: 12px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 80%;
  display: inline-block;
}

#chat-messages .user {
  margin-bottom: 12px;
  text-align: right;
  color: var(--warning);
  background: rgba(250, 204, 21, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 80%;
  display: inline-block;
  
  clear: both;
}

#chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#chat-input {
  flex-grow: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
  outline: none;
  background: var(--bg-medium);
  color: white;
  border-radius: 8px 0 0 8px;
}

#send-btn {
  border-radius: 0 8px 8px 0;
  padding: 0 15px;
  background: var(--primary-dark);
}

/* Tabs */
.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
}

.tab:hover:not(.active) {
  border-bottom: 2px solid var(--text-muted);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
    margin: 15px auto;
  }
  
  .trader-list, .stock-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  #chatbot {
    width: 90%;
    right: 5%;
    bottom: 100px;
  }
}