:root {
  --primary-color: #5d8dc3;
  --secondary-color: #4fd69c;
  --accent-color: #6f42c1;
  --dark-bg: #121212;
  --darker-bg: #0a0a0a;
  --lighter-bg: #1d1d1d;
  --text-color: #e1e1e1;
  --muted-text: #a0a0a0;
  --border-color: #2a2a2a;
  --highlight-border: var(--secondary-color);
  --example-bg: rgba(42, 42, 42, 0.95);
  --example-text: #ffffff;
  --example-border: #8a5dc8;
  --chat-bubble-user: rgba(111, 66, 193, 0.3);  /* Light purple tint */
  --chat-bubble-ai: rgb(0 0 0 / 65%);    /* Light green tint */
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--darker-bg);
  color: var(--text-color);
  font-family: 'Press Start 2P', cursive;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Full screen chart background */
.fullscreen-chart {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.85;
}

/* Header - 10% height */
.header {
  min-height: 10vh;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 20px;
  background-color: rgba(10, 10, 10, 0.8);
  border-bottom: 2px solid var(--accent-color);
  align-items: center;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-left .title {
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 4px;
}

.header-left .subtitle {
  font-size: 0.5rem;
  color: var(--muted-text);
  margin-bottom: 8px;
}

.connection-info {
  font-size: 0.6rem;
  color: var(--muted-text);
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-display {
  font-size: 1.2rem;
  color: var(--muted-text);
  margin-bottom: 5px;
}

.marketcap-display {
  font-size: 0.8rem;
  color: var(--muted-text);
}

.status {
  font-size: 0.6rem;
  margin-right: 5px;
}

/* Value change animations */
@keyframes valueIncrease {
  0% { color: var(--muted-text); }
  50% { color: #4cd964; }
  100% { color: var(--muted-text); }
}

@keyframes valueDecrease {
  0% { color: var(--muted-text); }
  50% { color: #ff3b30; }
  100% { color: var(--muted-text); }
}

.value-increase {
  animation: valueIncrease 1s ease-in-out;
}

.value-decrease {
  animation: valueDecrease 1s ease-in-out;
}

.status.connected {
  color: var(--secondary-color);
}

.status.disconnected {
  color: #e74c3c;
}

.user-count {
  font-size: 0.6rem;
  color: var(--muted-text);
  margin-left: 20px;
}

/* Chat area - 75% height */
.chat-area {
  height: 75vh;
  overflow-y: auto;
  z-index: 10;
  padding: 15px;
  background-color: rgba(18, 18, 18, 0.5);
}

.message-list {
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  border: 2px solid rgba(42, 42, 42, 0.7);
  border-radius: 5px;
}

/* Bubble style messages */
.message {
  display: flex;
  margin-bottom: 20px;
  position: relative;
  animation: fadeIn 0.3s ease-in;
  width: 100%;
}

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

.message .avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  box-sizing: border-box;
  overflow: hidden;
}

.ai-icon, .user-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  width: 100%;
  height: 100%;
  background-color: #212121;
  overflow: hidden;
  padding: 4px;
  font-size: 0.65rem;
  font-weight: bold;
}

.user-icon {
  font-size: 0.35rem;
}

.ai-icon {
  border: none;
  background-color: var(--secondary-color);
  color: #000000;
}

.user-icon {
  border: none;
  background-color: var(--accent-color);
  color: #ffffff;
}

.message .avatar i {
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.message .message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 60px);
}

.message .header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.message .user-id {
  font-size: 0.55rem;
  color: var(--accent-color);
  font-weight: bold;
}

.message .timestamp {
  font-size: 0.5rem;
  color: var(--muted-text);
  margin-left: auto;
  display: none;
}

.message .bubble {
  padding: 12px;
  border-radius: 10px;
  position: relative;
  word-wrap: break-word;
  font-size: 0.7rem;
  max-width: 100%;
}

.message.user-message .bubble {
  background-color: var(--chat-bubble-user);
  border: 1px solid var(--accent-color);
  align-self: flex-end;
}

.message.ai-message .bubble {
  background-color: var(--chat-bubble-ai);
  border: 1px solid var(--secondary-color);
  align-self: flex-start;
}

.message.loading {
  background-color: transparent;
}

.message.loading .bubble {
  background-color: rgba(30, 30, 30, 0.8);
  border: 2px solid var(--accent-color);
}

.message .content {
  word-wrap: break-word;
  font-size: 0.7rem;
}

.message .response {
  margin-top: 12px;
  padding: 8px;
  background-color: rgba(15, 15, 15, 0.7);
  border-radius: 5px;
  word-wrap: break-word;
  font-size: 0.65rem;
  border-left: 2px solid var(--secondary-color);
}

.message img {
  max-width: 100%;
  max-height: 250px;
  margin-top: 0;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.message pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.65rem;
  margin-bottom: 0;
  color: var(--text-color);
}

audio, video {
  max-width: 100%;
  border-radius: 4px;
}

/* Examples footer - 7% height */
.examples-footer {
  height: 7vh;
  min-height: 30px;
  z-index: 20;
  background-color: var(--example-bg);
  border-bottom: 2px solid var(--example-border);
  padding: 5px 10px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.examples-footer h2 {
  font-size: 0.7rem;
  color: var(--secondary-color);
  margin-right: 10px;
}

.examples-title {
  font-size: 0.7rem;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 5px;
}

.examples {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
}

.example-btn {
  font-size: 0.55rem;
  padding: 3px 5px;
  text-align: center;
  background-color: var(--darker-bg);
  border: 1px solid var(--example-border);
  color: var(--example-text);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-btn:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

/* Input area - 8% height */
.input-area {
  height: 8vh;
  min-height: 35px;
  z-index: 10;
  background-color: rgba(10, 10, 10, 0.8);
  border-top: 2px solid var(--accent-color);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  position: relative;
}

.input-field {
  flex: 0.9;
}

.input-field input {
  width: 100%;
  background-color: rgba(29, 29, 29, 0.9);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  font-size: 0.7rem;
  padding: 8px;
  height: 100%;
}

.input-field input:focus {
  border-color: var(--accent-color);
  outline: none;
}

.button-container {
  flex: 0.1;
  padding-left: 10px;
  height: 100%;
}

.button-container .nes-btn {
  width: 100%;
  padding: 8px;
  margin: 0;
  background-color: var(--accent-color);
  font-size: 0.7rem;
  height: 100%;
}

/* Loading animations */
@keyframes loadingSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes progressBarAnimation {
  0% { width: 0%; }
  50% { width: 50%; }
  80% { width: 80%; }
  95% { width: 95%; }
  100% { width: 95%; }
}

.loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: loadingSpinner 1s linear infinite;
}

.progress-container {
  width: 100%;
  height: 4px;
  background-color: var(--darker-bg);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--secondary-color);
  border-radius: 2px;
  animation: progressBarAnimation 60s ease-out forwards;
}

.loading-text {
  display: flex;
  align-items: center;
  font-size: 0.65rem;
}

/* Responsive adjustments */
@media (max-width: 968px) {
  .example-btn {
    font-size: 0.45rem;
  }
  
  .examples {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 10px;
    justify-content: center;
    text-align: center;
  }
  
  .header-left, .header-right {
    width: 100%;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .price-display {
    font-size: 1rem;
  }
  
  .examples {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .input-field {
    flex: 0.8;
  }
  
  .button-container {
    flex: 0.2;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 8px;
  }
  
  .examples {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .example-btn {
    font-size: 0.4rem;
  }
}

/* NES Character Icons */
.nes-icon {
  display: inline-block;
}

/* Loading styles */
.loading.nes-input, .loading.nes-btn, .example-btn.loading {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.loading.nes-input::placeholder {
  color: #4fd69c;
}

/* Top progress bar */
.top-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background-color: #4fd69c;
  z-index: 30;
  animation: progressAnimation 60s ease-out forwards;
  box-shadow: 0 0 10px rgba(79, 214, 156, 0.7);
}

@keyframes progressAnimation {
  0% { width: 0%; }
  10% { width: 15%; }
  30% { width: 40%; }
  50% { width: 55%; }
  70% { width: 65%; }
  90% { width: 85%; }
  100% { width: 92%; }
}

.nes-btn.is-warning {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
}

.nes-btn.is-warning:after {
  box-shadow: inset -4px -4px var(--accent-color) !important;
}

.nes-btn.is-warning:before {
  box-shadow: inset 4px 4px var(--accent-color) !important;
}

/* Using different color for AI */
.message.ai-message .user-id {
  color: var(--secondary-color);
  font-weight: bold;
} 