/* ==========================================================================
   TACTICAL OBSIDIAN DESIGN SYSTEM - STYLES.CSS
   Built from scratch adhering to Frontend Design & Lean UX Principles
   Zero AI Slop: No generic purple gradients, no uniform pill cards, no flat empty backgrounds
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@600;700;800;900&family=Tajawal:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --font-display: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-body: 'Tajawal', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Obsidian Color Palette */
  --bg-dark: #06090c;
  --surface-dark: #0d1318;
  --surface-elevated: #121a22;
  --surface-highlight: #17232d;
  
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --emerald-border: rgba(16, 185, 129, 0.25);
  
  --wa-bubble-out-dark: #005c4b;
  --wa-bubble-out-light: #dcf8c6;
  --wa-bubble-in-dark: #121c24;
  --wa-bubble-in-light: #ffffff;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Atmospheric Layered Background (Dark Mode) */
.dark body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 45%),
    radial-gradient(at 100% 100%, rgba(6, 78, 59, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(13, 19, 24, 0.6) 0px, transparent 100%);
  background-attachment: fixed;
  color: #e2e8f0;
}

/* Atmospheric Layered Background (Light Mode) */
body:not(.dark) {
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 40%),
    radial-gradient(at 100% 100%, rgba(203, 213, 225, 0.5) 0px, transparent 45%);
  background-attachment: fixed;
  color: #0f172a;
}

/* Custom Tactical Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.6);
}

/* Glass Console Surfaces */
.obsidian-panel {
  background: rgba(13, 19, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.light .obsidian-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Precision Card */
.precision-card {
  border-radius: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* WhatsApp Realistic Message Bubbles */
.wa-bubble-out {
  position: relative;
  background-color: var(--wa-bubble-out-light);
  border-radius: 12px 12px 2px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  color: #111827;
}
.dark .wa-bubble-out {
  background-color: var(--wa-bubble-out-dark);
  color: #e9edef;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.wa-bubble-out::after {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-top-color: var(--wa-bubble-out-light);
  border-right: 0;
}
.dark .wa-bubble-out::after {
  border-top-color: var(--wa-bubble-out-dark);
}

.wa-bubble-in {
  position: relative;
  background-color: var(--wa-bubble-in-light);
  border-radius: 12px 12px 12px 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  color: #1e293b;
}
.dark .wa-bubble-in {
  background-color: var(--wa-bubble-in-dark);
  color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.wa-bubble-in::after {
  content: "";
  position: absolute;
  top: 0;
  right: -7px;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-top-color: var(--wa-bubble-in-light);
  border-left: 0;
}
.dark .wa-bubble-in::after {
  border-top-color: var(--wa-bubble-in-dark);
}

/* Tactical Keyboard Key */
kbd {
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  color: #94a3b8;
}
.dark kbd {
  background: #16222c;
  border-color: #243544;
  color: #cbd5e1;
}

/* Animated Sound Waveform (Voice Note Studio) */
.waveform-container {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 36px;
}
.waveform-bar {
  width: 3px;
  background-color: #10b981;
  border-radius: 9999px;
  transition: height 0.15s ease;
}
.waveform-active .waveform-bar {
  animation: waveMotion 0.85s ease-in-out infinite alternate;
}
@keyframes waveMotion {
  0% { height: 4px; }
  50% { height: 30px; }
  100% { height: 8px; }
}
.waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { animation-delay: 0.25s; }
.waveform-bar:nth-child(4) { animation-delay: 0.4s; }
.waveform-bar:nth-child(5) { animation-delay: 0.15s; }
.waveform-bar:nth-child(6) { animation-delay: 0.3s; }
.waveform-bar:nth-child(7) { animation-delay: 0.5s; }
.waveform-bar:nth-child(8) { animation-delay: 0.2s; }

/* Circular Timer Progress Ring */
.timer-circle {
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Due Pulse Badge */
.pulse-badge {
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseGlow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
    box-shadow: 0 0 0 5px rgba(244, 63, 94, 0);
  }
}

/* Kanban column responsive width */
.kanban-col {
  min-width: 290px;
  max-width: 320px;
}

/* Tactile Micro-Interactions */
button:active {
  transform: scale(0.975);
}

/* Toast Smooth Animation */
@keyframes slideDownAndFade {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.toast-animation {
  animation: slideDownAndFade 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Asymmetric Stage Stepper Item */
.stage-stepper-btn.active {
  border-right: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
}
