* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #101212;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: #181818;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

h1 {
  color: #999;
  margin-bottom: 10px;
  font-size: 28px;
}

.subtitle {
  color: #999;
  margin-bottom: 30px;
  font-size: 14px;
}

.status {
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
}

.status.connected{
  background: #93C01F;
  color: #101212;
  border: 2px solid #101212;
}
.status.disconnected {
  background: #b3b3b3;
  color: #101212;
  border: 2px solid #101212;
}
.status.initializing {
  background: #c0a81f;
  color: #101212;
  border: 2px solid #101212;
}

.qr-container {
  margin: 30px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  display: none;
}

.qr-container.show {
  display: block;
}

.qr-container img {
  max-width: 280px;
  width: 100%;
  height: auto;
  border: 4px solid white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.qr-instruction {
  margin-top: 15px;
  color: #555;
  font-size: 14px;
}

.loader {
  border: 3px solid #181818;
  border-top: 3px solid #93C01F;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

.loader.show {
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #93C01F;
  font-size: 12px;
  color: #999;
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Button to view messages */
.view-messages-btn {
  margin-top: 20px;
  padding: 12px 24px;
  background: #93C01F;
  color: #101212;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(147, 192, 31, 0.3);
}

.view-messages-btn:hover {
  background: #7ca619;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(147, 192, 31, 0.4);
}

.view-messages-btn:active {
  transform: translateY(0);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #181818;
  border-radius: 16px;
  padding: 0;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #93C01F;
}

.modal-header h2 {
  color: #93C01F;
  font-size: 20px;
  margin: 0;
}

.close {
  color: #999;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close:hover {
  color: #93C01F;
}

.messages-list {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

/* Token input area inside modal */
.token-area {
  padding: 16px 24px 0 24px;
}
.token-title {
  color: #ddd;
  font-size: 14px;
  margin-bottom: 8px;
}
.token-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.token-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #202020;
  color: #eee;
}
.token-save {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #93C01F;
  color: #101212;
  font-weight: 600;
  cursor: pointer;
}
.token-hint {
  color: #777;
  font-size: 12px;
}
.token-sep {
  border: none;
  border-top: 1px solid #333;
  margin: 14px 0 0 0;
}

.message-item {
  background: #252525;
  border-left: 4px solid #93C01F;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  text-align: left;
  transition: transform 0.2s ease;
}

.message-item:hover {
  transform: translateX(4px);
  background: #2a2a2a;
}

.message-time {
  color: #93C01F;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.message-group {
  color: #999;
  font-size: 11px;
  margin-bottom: 8px;
  font-family: monospace;
}

.message-text {
  color: #ddd;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.loader-small {
  border: 3px solid #333;
  border-top: 3px solid #93C01F;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

.no-messages {
  text-align: center;
  color: #999;
  padding: 40px;
  font-size: 14px;
}

.no-messages::before {
  content: "📭";
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
}
