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

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-tertiary: #1a1a2e;
  --accent-purple: #7c3aed;
  --accent-blue: #00d9ff;
  --accent-green: #00ff88;
  --accent-yellow: #ffaa00;
  --accent-red: #ff4757;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --glass-bg: rgba(26, 26, 46, 0.8);
  --glass-border: rgba(124, 58, 237, 0.2);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 217, 255, 0.1) 0%, transparent 50%);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shield-icon {
  font-size: 2.5rem;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.5)); }
  50% { filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.8)); }
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.online-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-green);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.sidebar-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Main Content */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  padding: 1.5rem;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar h3 {
  font-size: 1rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
  font-weight: 600;
}

.scam-examples {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scam-example {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.scam-example:hover {
  border-color: var(--accent-purple);
  transform: translateX(5px);
}

.example-icon {
  font-size: 1.5rem;
}

.scam-example strong {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.25rem;
}

.scam-example p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.sidebar-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.clear-btn, .copy-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.clear-btn:hover { border-color: var(--accent-red); }
.copy-btn:hover { border-color: var(--accent-blue); }

/* Chat Section */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease;
}

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

.user-message {
  justify-content: flex-end;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  line-height: 1.5;
}

.user-bubble {
  background: linear-gradient(135deg, var(--accent-purple), #5b21b6);
  border-bottom-right-radius: 4px;
}

.ai-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}

.message-content {
  font-size: 0.95rem;
}

.message-content code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.message-content em {
  color: var(--text-secondary);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: right;
}

/* Risk Report */
.risk-report {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.risk-meter-container {
  margin-bottom: 1rem;
}

.risk-meter-bg {
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
}

.risk-meter-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease;
  animation: fillMeter 1s ease forwards;
}

@keyframes fillMeter {
  from { width: 0; }
}

.risk-meter-label {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.risk-score {
  font-size: 1.5rem;
  font-weight: 700;
}

.risk-text {
  font-size: 0.85rem;
}

.verdict {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-align: center;
  margin: 0.75rem 0;
}

.verdict.safe {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.verdict.suspicious {
  background: rgba(255, 170, 0, 0.15);
  color: var(--accent-yellow);
  border: 1px solid var(--accent-yellow);
}

.verdict.danger {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  animation: dangerPulse 0.5s ease;
}

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.flags-section {
  margin: 0.75rem 0;
}

.flags-section h4 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--accent-red);
}

.flags-section ul {
  list-style: none;
  font-size: 0.85rem;
}

.flags-section li {
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.flags-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-red);
}

.recommendation {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: rgba(0, 217, 255, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--accent-blue);
}

.recommendation h4 {
  font-size: 0.85rem;
  color: var(--accent-blue);
  margin-bottom: 0.25rem;
}

.recommendation p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.confidence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

.analyzing-text {
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Input Section */
.input-section {
  padding: 1rem 1.5rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}

.input-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
}

.tab-btn:hover:not(.active) {
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.input-area {
  margin-bottom: 1rem;
}

.text-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.url-input-container {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0 1rem;
  transition: border-color 0.2s;
}

.url-input-container:focus-within {
  border-color: var(--accent-purple);
}

.url-icon {
  font-size: 1.2rem;
  margin-right: 0.75rem;
}

.url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  padding: 1rem 0;
}

.url-input:focus {
  outline: none;
}

.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.05);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.drop-icon {
  font-size: 2.5rem;
}

.drop-content p {
  color: var(--text-primary);
}

.file-types {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-preview img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.file-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.file-name {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file {
  background: var(--accent-red);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-purple), #5b21b6);
  border: none;
  color: white;
  padding: 1rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-btn.analyzing {
  background: var(--bg-tertiary);
}

.scan-animation {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
}

.footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: fall 3s ease-out forwards;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

  .input-tabs {
    justify-content: center;
  }

  .tab-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .header h1 {
    font-size: 1.2rem;
  }

  .shield-icon {
    font-size: 2rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9333ea;
}