* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; height: 100vh; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

::selection { background: rgba(139,92,246,0.3); color: #fff; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes sendPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes berryRain {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}
@keyframes confettiBurst {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-200px) scale(0); opacity: 0; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.15); }
  50% { box-shadow: 0 0 40px rgba(139,92,246,0.3); }
}
@keyframes typeWriter {
  from { width: 0; }
  to { width: 100%; }
}

.anim-fade { animation: fadeIn 0.4s ease-out; }
.anim-slide-l { animation: slideInLeft 0.3s ease-out; }
.anim-slide-r { animation: slideInRight 0.3s ease-out; }
.anim-slide-up { animation: slideUp 0.35s ease-out; }
.anim-modal { animation: modalIn 0.25s ease-out; }
.anim-pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }
.anim-spin { animation: spin-slow 1s linear infinite; }
.anim-send { animation: sendPulse 0.3s ease-out; }
.anim-glow { animation: glow 3s ease-in-out infinite; }

.email-row {
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.email-row:hover {
  background-color: rgba(139,92,246,0.04);
}

.folder-btn {
  transition: all 0.15s ease;
  position: relative;
}
.folder-btn:hover {
  background-color: rgba(139,92,246,0.06);
}
.folder-btn.active {
  background: linear-gradient(90deg, rgba(139,92,246,0.12), transparent);
}
.folder-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #8b5cf6, #ec4899);
}

.connect-card {
  background: linear-gradient(165deg, rgba(15,22,40,0.97), rgba(10,15,28,0.99));
  border: 1px solid rgba(139,92,246,0.1);
  box-shadow: 0 30px 100px rgba(0,0,0,0.6), 0 0 80px rgba(139,92,246,0.05);
}

.input-field {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}
.input-field:focus {
  outline: none;
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.04);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.08);
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(124,58,237,0.25);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(124,58,237,0.4);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.15);
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: rgba(139,92,246,0.14);
  border-color: rgba(139,92,246,0.25);
}

.detail-panel {
  background: linear-gradient(180deg, rgba(15,22,40,0.3), rgba(6,8,15,0.6));
}

.compose-overlay {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
}

.compose-modal {
  background: linear-gradient(165deg, rgba(15,22,40,0.98), rgba(10,15,28,0.99));
  border: 1px solid rgba(139,92,246,0.12);
  box-shadow: 0 40px 120px rgba(0,0,0,0.7), 0 0 60px rgba(139,92,246,0.06);
}

.sidebar-bg {
  background: linear-gradient(180deg, rgba(10,15,28,0.98), rgba(6,8,15,0.99));
  border-right: 1px solid rgba(255,255,255,0.04);
}

.unread-badge {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 5px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.status-msg {
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.04), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.badge-real {
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.2);
}

.badge-berrry {
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.2);
}

.tab-btn {
  transition: all 0.2s ease;
  position: relative;
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 2px;
}

.import-zone {
  border: 2px dashed rgba(139,92,246,0.2);
  transition: all 0.2s ease;
}
.import-zone:hover, .import-zone.drag-over {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.04);
}

.berry-rain-drop {
  position: fixed;
  font-size: 20px;
  pointer-events: none;
  z-index: 9999;
  animation: berryRain 2s ease-in forwards;
}

.confetti-piece {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: confettiBurst 1.5s ease-out forwards;
}

.raw-source-view {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
  white-space: pre-wrap;
  word-break: break-all;
}

.ai-suggestion {
  background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(236,72,153,0.04));
  border: 1px solid rgba(139,92,246,0.1);
  transition: all 0.15s ease;
}
.ai-suggestion:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(236,72,153,0.08));
  border-color: rgba(139,92,246,0.2);
}

@media (max-width: 768px) {
  body { overflow: auto; height: auto; }
}