* { font-family: 'Noto Sans Thai', sans-serif; }
body { background: #0a0a0f; color: #e5e5e5; }

.glass {
  background: rgba(20, 20, 30, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
  background: rgba(15, 15, 25, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #f472b6 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  border: none;
  cursor: pointer;
}
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}
.btn-gradient:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.card-hover { transition: all 0.3s; }
.card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 10px 40px rgba(167, 139, 250, 0.15);
}

.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: #555; }

.message-content pre {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}
.message-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
}
.message-content p code {
  background: rgba(167, 139, 250, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: #c4b5fd;
}
.message-content p { margin: 8px 0; line-height: 1.7; }
.message-content ul, .message-content ol { margin: 8px 0; padding-left: 24px; }
.message-content li { margin: 4px 0; }
.message-content h1, .message-content h2, .message-content h3 { margin: 16px 0 8px; font-weight: 600; }
.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.15em; }
.message-content a { color: #60a5fa; text-decoration: underline; }
.message-content blockquote {
  border-left: 3px solid #a78bfa;
  padding-left: 12px;
  margin: 8px 0;
  color: #aaa;
}
.message-content table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.message-content th, .message-content td { border: 1px solid #333; padding: 8px 12px; }
.message-content th { background: rgba(167, 139, 250, 0.1); }

.typing-cursor::after {
  content: '▊';
  animation: blink 1s infinite;
  color: #a78bfa;
  margin-left: 2px;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in { animation: slideIn 0.3s ease-out; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.pulse-glow { animation: pulseGlow 2s infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(167, 139, 250, 0.3); }
  50% { box-shadow: 0 0 40px rgba(167, 139, 250, 0.6); }
}

.sidebar-item { transition: all 0.2s; }
.sidebar-item:hover {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.3);
}
.sidebar-item.active {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.5);
}

.nav-link { transition: all 0.2s; position: relative; color: #ccc; text-decoration: none; }
.nav-link:hover {
  background: rgba(167, 139, 250, 0.1);
  color: #c4b5fd;
}
.nav-link.active {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, #a78bfa, #f472b6);
  border-radius: 0 3px 3px 0;
}

.copy-btn {
  opacity: 0;
  transition: opacity 0.2s;
}
pre:hover .copy-btn { opacity: 1; }

textarea { resize: none; }

.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-bg {
  background: 
    radial-gradient(circle at 20% 20%, rgba(167, 139, 250, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(244, 114, 182, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(96, 165, 250, 0.1) 0%, transparent 50%),
    #0a0a0f;
  min-height: 100vh;
}

.input-field {
  background: rgba(15, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}
.input-field:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
  outline: none;
}

@media (max-width: 768px) {
  .sidebar-desktop {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar-desktop.open { transform: translateX(0); }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}
.sidebar-backdrop.active { display: block; }