:root {
  --bg-color: #12131a;
  --surface-color: #1e1f26;
  --surface-low: #1a1b22;
  --surface-high: #282a31;
  --border-color: rgba(255, 255, 255, 0.07);
  --text-primary: #e2e1eb;
  --text-secondary: #cbc3d7;
  --outline: #958ea0;
  --accent-color: #d0bcff;
  --accent-container: #a078ff;
  --accent-hover: #bfa5ff;
  --danger: #ffb4ab;
  --danger-container: #93000a;
  --success: #6dd58c;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Geist', monospace;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Custom Obsidian Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Neomorphic & Glassmorphic Utilities */
.neomorphic-card {
  background: linear-gradient(145deg, rgba(30, 31, 38, 0.85), rgba(24, 25, 32, 0.85));
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.05),
              0 4px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.neomorphic-input {
  background: rgba(18, 19, 26, 0.7);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5),
              inset -1px -1px 2px rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.neomorphic-input:focus {
  border-color: rgba(208, 188, 255, 0.5);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5), 0 0 12px rgba(208, 188, 255, 0.25);
  outline: none;
}

.glass-panel {
  background: rgba(40, 42, 49, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Email Item Card */
.email-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(30, 31, 38, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 8px;
}
.email-row:hover {
  background: rgba(40, 42, 49, 0.8);
  border-color: rgba(208, 188, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.email-row.active {
  background: rgba(160, 120, 255, 0.15);
  border-color: rgba(208, 188, 255, 0.5);
}

/* Badges */
.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge.unverified {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Dark Quill Editor Styling */
.ql-toolbar.ql-snow {
  background: #1a1b22 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px 10px 0 0 !important;
}
.ql-toolbar.ql-snow .ql-stroke {
  stroke: #cbc3d7 !important;
}
.ql-toolbar.ql-snow .ql-fill {
  fill: #cbc3d7 !important;
}
.ql-toolbar.ql-snow .ql-picker {
  color: #cbc3d7 !important;
}
.ql-container.ql-snow {
  background: #12131a !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: none !important;
  border-radius: 0 0 10px 10px !important;
  color: #e2e1eb !important;
  font-family: var(--font-sans) !important;
  font-size: 0.95rem !important;
}
.ql-editor {
  min-height: 180px;
  color: #e2e1eb !important;
}
.ql-editor.ql-blank::before {
  color: #958ea0 !important;
  font-style: normal !important;
}

/* Pulsating cursor / subtle effects */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(208, 188, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(208, 188, 255, 0.6); }
}
.pulse-glow {
  animation: pulseGlow 2.5s infinite;
}

/* Micro-Animations & Real-World Interaction Effects */
@keyframes modalSpring {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  60% { opacity: 1; transform: scale(1.02) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes floatIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ripplePulse {
  0% { box-shadow: 0 0 0 0 rgba(208, 188, 255, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(208, 188, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(208, 188, 255, 0); }
}

@keyframes shimmerGlow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.modal-spring {
  animation: modalSpring 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.row-float {
  animation: floatIn 0.25s ease-out forwards;
}

.btn-ripple:active {
  animation: ripplePulse 0.6s ease-out;
}

.shimmer-loading {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmerGlow 1.8s infinite;
}

/* --- AUTH & LOGIN FLUID ANIMATIONS --- */
@keyframes cardShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes stepSlideIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authSuccessGlow {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); border-color: rgba(52, 211, 153, 0.6); }
  70% { box-shadow: 0 0 24px 8px rgba(52, 211, 153, 0.2); border-color: rgba(52, 211, 153, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); border-color: rgba(255, 255, 255, 0.1); }
}

.auth-step-anim {
  animation: stepSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-shake {
  animation: cardShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.success-glow {
  animation: authSuccessGlow 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Smart Reply Chips */
.smart-reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(208, 188, 255, 0.08);
  border: 1px solid rgba(208, 188, 255, 0.2);
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.smart-reply-chip:hover {
  background: rgba(208, 188, 255, 0.2);
  border-color: rgba(208, 188, 255, 0.4);
  transform: translateY(-1px);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* SOC Metrics & Security Dashboard */
.soc-card {
  background: linear-gradient(135deg, rgba(26, 27, 34, 0.9), rgba(18, 19, 26, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  transition: all 0.25s ease;
}
.soc-card:hover {
  border-color: rgba(208, 188, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* In-App Attachment Preview Modal */
.preview-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 11, 16, 0.85);
}

/* Offline Banner Pulse */
@keyframes offlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.offline-indicator {
  animation: offlinePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile Responsive Adjustments (< 768px) */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #compose-window {
    width: 100% !important;
    max-width: 100vw !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh !important;
  }

  .email-row {
    padding: 12px 14px;
    gap: 10px;
  }

  /* Safe area inset for modern iPhones / Androids */
  .mobile-nav-bar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}


