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

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-modal: #111111;
  --bg-input: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --text-primary: #ffffff;
  --text-secondary: #d4d4d4;
  --text-muted: #737373;
  --accent-dark: #1a1a1a;
  --accent-dark-hover: #262626;
  --accent-button: #1f1f1f;
  --accent-button-hover: #2a2a2a;
  --error-color: #dc2626;
  --success-color: #16a34a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Community Access Page */
.support-access-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: var(--text-primary);
}

.modal-instruction {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}

.hash-form {
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.hash-input {
  width: 100%;
  padding: 14px 100px 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.hash-input:focus {
  outline: none;
  border-color: var(--border-light);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.hash-input::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
}

.char-counter {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.submit-button {
  width: 100%;
  padding: 14px;
  background: var(--accent-button);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--accent-button-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-message {
  color: var(--error-color);
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
  display: none;
}

.error-message.show {
  display: block;
}

.assistance-text {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 24px;
}

/* Chat Page */
.chat-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.chat-container {
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 800px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-modal);
}

.header-info h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-info-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.logout-button {
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.2);
  color: var(--error-color);
  border: 1px solid var(--error-color);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-button:hover {
  background: var(--error-color);
  color: var(--text-primary);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

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

.messages-container::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.messages-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.welcome-message {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-style: italic;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  animation: messageSlideIn 0.3s ease;
}

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

.message.own-message {
  align-self: flex-end;
}

.message.other-message {
  align-self: flex-start;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.message.own-message .message-header {
  justify-content: flex-end;
}

.message-user {
  font-weight: 600;
  color: var(--text-secondary);
}

.message-time {
  color: var(--text-muted);
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.5;
  position: relative;
}

.message.own-message .message-content {
  background: var(--accent-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-right-radius: 4px;
}

.message.own-message .message-content.premium-border {
  border: 2px solid transparent;
}

.message.other-message .message-content {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message.other-message .message-content.premium-border {
  border: 2px solid transparent;
}

/* Premium Text Styles */
.premium-text {
  background: linear-gradient(90deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: neonGlow 3s ease infinite;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 0, 128, 0.5),
               0 0 20px rgba(255, 140, 0, 0.5),
               0 0 30px rgba(64, 224, 208, 0.5);
  filter: drop-shadow(0 0 8px rgba(255, 0, 128, 0.6));
  display: inline-block;
}

@keyframes neonGlow {
  0% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 8px rgba(255, 0, 128, 0.6));
  }
  33% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.6));
  }
  66% {
    background-position: 200% 50%;
    filter: drop-shadow(0 0 8px rgba(64, 224, 208, 0.6));
  }
  100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 8px rgba(255, 0, 128, 0.6));
  }
}

/* Premium Message Border Styles */
.message-content.premium-border {
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.message-content.premium-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(90deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
  animation: neonBorderGlow 3s ease infinite;
}

.message.own-message .message-content.premium-border::before {
  border-bottom-right-radius: 4px;
}

.message.other-message .message-content.premium-border::before {
  border-bottom-left-radius: 4px;
}

@keyframes neonBorderGlow {
  0% {
    background-position: 0% 50%;
  }
  33% {
    background-position: 100% 50%;
  }
  66% {
    background-position: 200% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Reply Styles */
.reply-preview {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--border-light);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.reply-preview-user {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reply-preview-text {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-to-message {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--border-light);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s;
}

.reply-to-message:hover {
  background: rgba(255, 255, 255, 0.08);
}

.reply-to-user {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reply-to-text {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.7;
}

.reply-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
  opacity: 1;
  transform: translateY(-1px);
}

.reply-button:active {
  transform: translateY(0);
}

.reply-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.replying-indicator {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.replying-indicator-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cancel-reply {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.cancel-reply:hover {
  background: rgba(255, 255, 255, 0.1);
}

.system-message {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px;
  margin: 8px 0;
}

.typing-indicator {
  padding: 8px 24px;
  min-height: 32px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.input-container {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-modal);
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.message-input:focus {
  outline: none;
  border-color: var(--border-light);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.message-input::placeholder {
  color: var(--text-muted);
}

.send-button {
  padding: 12px 20px;
  background: var(--accent-button);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-width: 48px;
}

.send-button:hover:not(:disabled) {
  background: var(--accent-button-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.send-button:active:not(:disabled) {
  transform: translateY(0);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal {
    padding: 32px 24px;
  }

  .modal-title {
    font-size: 28px;
  }

  .chat-container {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .message {
    max-width: 85%;
  }
}

