:root {
    --primary-color: #9945FF;
    --buy-color: #14F195;
    --sell-color: #F44336;
    --text-color-on-primary: #fff;
    --primary-color-transparent: rgba(153, 69, 255, 0.8);
    --buy-color-transparent: rgba(20, 241, 149, 0.2);
}

body.chain-solana {
    --primary-color: #9945FF;
    --buy-color: #14F195;
    --text-color-on-primary: #fff;
    --primary-color-transparent: rgba(153, 69, 255, 0.8);
    --buy-color-transparent: rgba(20, 241, 149, 0.2);
}

html {
    height: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  background-color: #000;
  height: 100%;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#avatar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

#avatar-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#price-info {
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 4;
  margin: 30px 0 0 0;
  font-size: 16px;
  color: #fff;
  font-weight: bold;
  display: flex;
  justify-content: center;
  gap: 40px;
}

#price-info span{
  font-size: 64px;
  font-weight: normal;
}

#contract-address {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color-on-primary);
    margin-top: 20px;
    word-break: break-all;
    background-color: var(--primary-color-transparent);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

#ai-response-container {
    text-align: center;
    padding: 0 20px;
    margin: 10px 0 20px 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 4;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

#ai-original-message {
    font-size: 50px;
    color: #aaa;
    margin-bottom: 8px;
    word-wrap: break-word;
    max-width: 70%;
}

#ai-original-message strong {
    color: var(--primary-color);
}

#ai-response-text {
    font-size: 24px;
    color: #fff;
    word-wrap: break-word;
    max-width: 70%;
}

#trade-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.animated-trade {
    position: absolute;
    font-size: 48px;
    font-weight: normal;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    white-space: nowrap;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out forwards;
}

.animated-trade.buy {
    color: var(--buy-color);
}

.animated-trade.sell {
    color: var(--sell-color);
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    25% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

#chat-container {
    position: fixed;
    right: 20px;
    top: auto;
    height: 500px;
    bottom: 20px;
    width: 550px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    backdrop-filter: blur(5px);
}

#chat-messages {
    list-style: none;
    padding: 15px;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column-reverse;
    font-size: 30px;
}

#chat-messages li {
    margin-bottom: 10px;
    color: #fff;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

#chat-messages li strong {
    color: var(--primary-color);
}

#chat-form {
    display: none; /* Hidden by default */
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chat-input {
    flex-grow: 1;
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    padding: 8px;
    border-radius: 5px;
    margin-right: 10px;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#chat-form button {
    background-color: var(--primary-color);
    color: var(--text-color-on-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}


#trade-feed {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    z-index: 10;
}

.trade-item {
    padding: 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    animation: fadeIn 0.5s ease;
}

.trade-item.buy {
    background-color: var(--buy-color-transparent);
    border-left: 3px solid var(--buy-color);
}

.trade-item.sell {
    background-color: rgba(244, 67, 54, 0.2);
    border-left: 3px solid #F44336;
}

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

.avatar-labels {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

#enable-audio-btn {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    background-color: var(--primary-color);
    color: var(--text-color-on-primary);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: block; /* Initially shown */
}

.avatar-label {
  background-color: rgb(33 33 33 / 57%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: none;
}

.bubble {
  position: fixed;
  background-color:#181818;
  color: #14F195;
  padding: 15px;
  border-radius: 15px;
  max-width: 300px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: none;
  transition: opacity 0.5s ease;
  font-size: 14px;
  text-align: center;
}

#bubble-1 {
  top: 80px;
  left: 120px;
  border-bottom-left-radius: 0;
}

#bubble-2 {
  top: 80px;
  right: 120px;
  border-bottom-right-radius: 0;
}

.bubble:after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 15px solid transparent;
}


.controls {
  position: fixed;
  bottom: 70px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  display: none;
}

#status{
  color: #fff;
}

.status {
  display: inline-block;
  padding: 5px 10px;
  background-color: #000;
  border-radius: 5px;
  font-size: 12px;
}

.marketcap, .token-price {
  font-weight: bold;
  transition: color 0.3s;
}

.up {
  color: var(--buy-color);
}

.down {
  color: var(--sell-color);
}

.stable {
  color: #fff;
}

#chart-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

@media (max-width: 768px) {
    #chat-container {
        display: flex; /* Make it visible */
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 40%; /* Take up 40% of the screen height */
        border-radius: 0;
        border-top: 1px solid var(--primary-color);
    }

    #chat-messages {
        font-size: 14px;
    }

    #contract-address {
        font-size: 14px;
    }

    #price-info span {
        font-size: 48px;
    }

    #ai-original-message {
        font-size: 24px;
        max-width: 90%;
    }

    #ai-response-text {
        font-size: 18px;
        max-width: 90%;
    }
}
