/**
 * OpenKitx403 AI Agent
 * Matching NFT Gallery UI/UX theme
 */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #141414;
  --bg-tertiary: #1A1A1A;
  --accent-primary: #9945FF;
  --accent-secondary: #14F195;
  --text-primary: #FFFFFF;
  --text-secondary: #A3A3A3;
  --text-muted: #737373;
  --border: #262626;
  --success: #14F195;
  --error: #EF4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.demo-badge, 
.tech-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-badge {
  background: var(--accent-primary);
  color: white;
}

.header-info {
  display: flex;
  gap: 8px;
}

.tech-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Main */
.main {
  flex: 1;
  padding: 80px 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero */
.hero-section {
  text-align: center;
  margin-bottom: 64px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* Chat Container */
.chat-container {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  height: 600px;
  transition: border-color var(--transition);
}

.chat-container:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Messages */
.welcome-message,
.agent-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.agent-avatar {
  width: 48px;
  height: 48px;
  background: var(--accent-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.message-text {
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.message-text:last-child {
  margin-bottom: 0;
}

.capability-list {
  list-style: none;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.capability-list li {
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
  font-size: 14px;
}

.capability-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-secondary);
  font-weight: bold;
  font-size: 18px;
}

/* User Message */
.user-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-direction: row-reverse;
  animation: fadeIn 0.3s ease-out;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  font-weight: 700;
}

.user-message .message-content {
  background: rgba(153, 69, 255, 0.15);
  border-color: var(--accent-primary);
}

/* Agent Response - monospace */
.agent-message .message-content {
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 24px 16px 24px;
}

.agent-avatar-small {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.typing-dots {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 60%, 100% { 
    transform: translateY(0); 
  }
  30% { 
    transform: translateY(-8px); 
  }
}

/* Chat Input */
.chat-input-container {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  background: var(--bg-tertiary);
}

.example-prompts {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.example-prompt {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.example-prompt:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(153, 69, 255, 0.05);
}

.chat-input-form {
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
}

.chat-input:focus {
  border-color: var(--accent-primary);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.send-button {
  padding: 12px 20px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-2px);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Info Section */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.info-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}

.info-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.info-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.info-list, 
.tech-list {
  list-style: none;
  color: var(--text-secondary);
  line-height: 1.8;
}

.info-list li {
  counter-increment: item;
  padding-left: 40px;
  position: relative;
  margin-bottom: 12px;
  font-size: 14px;
}

.info-list {
  counter-reset: item;
}

.info-list li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.tech-list li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
}

.tech-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-secondary);
  font-weight: bold;
  font-size: 18px;
}

.tech-list strong {
  color: var(--accent-secondary);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-text {
  color: var(--text-muted);
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
}

.footer-text a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-text a:hover {
  color: var(--accent-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .main {
    padding: 48px 16px;
  }

  .header {
    padding: 0 16px;
  }

  .header-content {
    height: auto;
    padding: 16px 0;
  }

  .hero-section {
    margin-bottom: 48px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .chat-container {
    height: 500px;
  }

  .chat-messages {
    padding: 16px;
  }

  .example-prompts {
    display: none;
  }

  .info-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero-title {
    font-size: 28px;
  }

  .chat-container {
    height: 450px;
  }

  .agent-avatar {
    width: 40px;
    height: 40px;
  }

  .message-content {
    padding: 16px;
  }
}
