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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000;
  color: #fff;
  height: 100vh;
  overflow: hidden;
}

.container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Background Effects */
.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.gradient-orb {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: blur(150px);
  opacity: 0.3;
  animation: float 8s ease-in-out infinite;
}

.pink {
  background: linear-gradient(45deg, rgba(70, 57, 255, 0.3), rgba(0, 239, 169, 0.3));
  animation-delay: -2s;
}

.purple {
  background: linear-gradient(-45deg, rgba(0, 239, 169, 0.3), rgba(70, 57, 255, 0.3));
  animation-delay: -4s;
}

.blue {
  background: linear-gradient(90deg, rgba(70, 57, 255, 0.3), rgba(0, 239, 169, 0.3));
  animation-delay: -6s;
}

/* Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4639ff, #00efa9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nav-logo {
  width: 70%;
  height: 70%;
  object-fit: cover;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(to right, #4639ff, #00efa9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-item {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.nav-item:hover {
  color: white;
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #4639ff, #00efa9);
}

/* Wallet Button */
.wallet-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.wallet-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.wallet-button i {
  font-size: 16px;
}

/* Announcement Banner */
.announcement-banner {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #4639ff;
  width: 100%;
  color: white;
  border-radius: 0px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 9;
  box-shadow: 0 2px 10px rgba(70, 57, 255, 0.3);
}

.announcement-banner:hover {
  background: rgba(70, 57, 255, 0.8);
  transform: translateX(-50%) translateY(-2px);
}

/* Chatroom Container */
.chatroom-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 120px;
  padding-bottom: 80px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: 100vh;
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 1rem 2rem;
  margin: 1rem 2rem;
  background: rgba(0, 239, 169, 0.1);
  border: 1px solid rgba(0, 239, 169, 0.3);
  border-radius: 12px;
  color: #00efa9;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.connection-status i {
  font-size: 1.2rem;
}

/* Chat Interface */
.chat-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0 1rem;
  background: rgba(23, 23, 23, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
}

.chat-title i {
  color: #4639ff;
}

.online-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.online-indicator {
  color: #00efa9;
  font-size: 0.8rem;
  animation: pulse 2s infinite;
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(70, 57, 255, 0.5);
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(70, 57, 255, 0.7);
}

/* Message Styles */
.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 3px solid #4639ff;
  animation: slideIn 0.3s ease-out;
  max-width: 70%;
  align-self: flex-start;
}

.message.own {
  background: rgba(70, 57, 255, 0.1);
  border-left: none;
  border-right: 3px solid #00efa9;
  margin-left: auto;
  margin-right: 0;
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
}

.message:not(.own) {
  border-radius: 12px 12px 12px 4px;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.message-username {
  font-weight: 600;
  color: #00efa9;
  font-size: 0.9rem;
}

.message.own .message-username {
  color: #4639ff;
}

.message-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 5px;
}

.message-content {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  word-wrap: break-word;
}

/* Message Input */
.message-input-container {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

#message-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

#message-input:focus {
  border-color: #4639ff;
  background: rgba(255, 255, 255, 0.15);
}

#message-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#message-input:disabled {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  opacity: 0.6;
}

#message-input:disabled::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#send-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4639ff, #00efa9);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#send-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(70, 57, 255, 0.4);
}

#send-button:disabled {
  background: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  opacity: 0.5;
}

.input-info {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.char-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Bottom Navigation */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  padding: 1rem;
  justify-content: space-around;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  align-items: center;
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0.5rem 8px;
  border-radius: 8px;
  min-width: auto;
  justify-content: center;
}

.bottom-nav .nav-item i {
  font-size: 1.2rem;
}

.bottom-nav .nav-item span {
  font-size: 0.9rem;
}

.bottom-nav .nav-item:hover {
  color: rgba(255, 255, 255, 0.8);
}

.bottom-nav .nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #4639ff, #00efa9);
  padding: 0.5rem 1rem;
}

/* Footer */
.footer {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  padding: 1rem;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9;
}

/* Animations */
@keyframes float {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(-30px) translateX(-20px);
  }
  25% {
    transform: translate(-50%, -50%) translateY(0px) translateX(20px);
  }
  50% {
    transform: translate(-50%, -50%) translateY(30px) translateX(-10px);
  }
  75% {
    transform: translate(-50%, -50%) translateY(0px) translateX(10px);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .chatroom-container {
    padding: 100px 0.5rem 80px;
  }

  .chat-interface {
    margin: 0;
  }

  .message {
    max-width: 85%;
  }

  .message.own {
    margin-left: auto;
    margin-right: 0;
  }

  .wallet-button {
    margin-left: auto;
    white-space: nowrap;
    padding: 6px 12px;
  }

  .top-nav {
    justify-content: space-between;
    padding: 1rem 2rem;
  }

  .bottom-nav .nav-item {
    min-width: auto;
    padding: 0.5rem;
  }

  .footer {
    display: none;
  }
}

@media (max-width: 480px) {
  .bottom-nav .nav-item {
    min-width: auto;
  }

  .chat-header {
    padding: 0.75rem 1rem;
  }

  .message-input-container {
    padding: 0.75rem 1rem;
  }
}