/* MoshaverOS - Professional Design System & Luxury Theme */

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

:root, html.light {
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-overlay: #f1f5f9;
  --color-border: #e2e8f0;
  --color-hover: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-primary: #4f46e5;
  --color-accent: #d97706;
  --color-success: #059669;
  --color-danger: #dc2626;
  --touch-target-min: 44px;
}

html.dark {
  --color-bg: #0b0f19;
  --color-card: #111827;
  --color-overlay: #1f2937;
  --color-border: #374151;
  --color-hover: #1e293b;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-primary: #6366f1;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
}

/* Light Theme Overrides */
html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light header {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-bottom-color: #e2e8f0 !important;
}

html.light .bg-surface-base {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .bg-surface-card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06) !important;
}

html.light .bg-surface-hover {
  background-color: #f1f5f9 !important;
}

html.light .border-surface-border {
  border-color: #e2e8f0 !important;
}

html.light .text-white {
  color: #0f172a;
}

html.light button.text-white,
html.light a.text-white,
html.light .role-btn.bg-brand-600,
html.light [class*="bg-brand-600"],
html.light [class*="bg-brand-700"],
html.light [class*="bg-rose-600"],
html.light [class*="bg-emerald-600"],
html.light [class*="bg-indigo-600"] {
  color: #ffffff !important;
}

html.light .text-slate-100 {
  color: #0f172a;
}

html.light .text-slate-200 {
  color: #1e293b;
}

html.light .text-slate-300 {
  color: #334155;
}

html.light .text-slate-400 {
  color: #64748b;
}

html.light input, html.light select, html.light textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html.light footer {
  background-color: #ffffff !important;
  border-top-color: #e2e8f0 !important;
}

/* Base Typographic & Directional Settings */
html {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  direction: rtl;
  text-align: right;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-feature-settings: "ss01" on;
}

/* Ergonomic Touch Targets */
button, 
input, 
select, 
textarea,
a {
  touch-action: manipulation;
}

.touch-target {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Custom Scrollbar for Luxury Dark Aesthetic */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0b0f19;
}

::-webkit-scrollbar-thumb {
  background: #2d3748;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(55, 65, 81, 0.6);
}

.glass-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(75, 85, 99, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.glass-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  transition: all 0.2s ease-in-out;
}

.glass-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  outline: none;
}

/* Role Button Active State */
.role-btn {
  color: #94a3b8;
  border: 1px solid transparent;
}

.role-btn:hover {
  color: #f8fafc;
  background-color: rgba(55, 65, 81, 0.4);
}

.role-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-color: #818cf8;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

/* Subnav Tab Styling */
.subnav-btn {
  position: relative;
  transition: all 0.2s ease;
  color: #94a3b8;
}

.subnav-btn:hover {
  color: #ffffff;
}

.subnav-btn.active {
  color: #818cf8;
  font-weight: 700;
}

.subnav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #6366f1;
  border-radius: 9999px 9999px 0 0;
  box-shadow: 0 -2px 8px rgba(99, 102, 241, 0.8);
}

/* Animated Fire Streak */
@keyframes flameFlicker {
  0% {
    transform: scale(1) rotate(-1deg);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7));
  }
  25% {
    transform: scale(1.06) rotate(1.5deg);
    filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.85));
  }
  50% {
    transform: scale(0.98) rotate(-1deg);
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.75));
  }
  75% {
    transform: scale(1.08) rotate(1deg);
    filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.95));
  }
  100% {
    transform: scale(1) rotate(-1deg);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.7));
  }
}

.flame-icon-animated {
  animation: flameFlicker 2.4s infinite ease-in-out;
  display: inline-block;
  transform-origin: center bottom;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
  }
  50% {
    box-shadow: 0 0 28px rgba(245, 158, 11, 0.7);
  }
}

.streak-card-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

/* Mood Button Animations & Interactivity */
.mood-btn {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0);
}

.mood-btn:hover {
  transform: translateY(-4px) scale(1.08);
}

.mood-btn.selected {
  transform: translateY(-6px) scale(1.12);
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Badge Showcase Styling */
.badge-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.badge-card:hover {
  transform: translateY(-4px);
}

.badge-unlocked {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-unlocked:hover {
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.25);
}

.badge-locked {
  background: rgba(17, 24, 39, 0.4);
  border: 1px dashed rgba(75, 85, 99, 0.4);
  filter: grayscale(0.85);
  opacity: 0.75;
}

.badge-locked:hover {
  opacity: 0.95;
  filter: grayscale(0.4);
}

/* Shimmer Effect for Loading / Highlights */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-bar {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* Notification Toast Animation */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-item {
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

/* Slump Radar Critical Pulse */
@keyframes criticalPulse {
  0%, 100% {
    border-color: rgba(239, 68, 68, 0.4);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
  }
}

.radar-critical {
  animation: criticalPulse 2s infinite ease-in-out;
}

/* Mobile Anti-Slop Utilities */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.touch-target-48 {
  min-height: 48px;
  min-width: 48px;
}

.notebook-paper-pattern {
  background-image: radial-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 16px 16px;
}

.thumb-active {
  transition: transform 0.1s ease, background-color 0.15s ease;
}
.thumb-active:active {
  transform: scale(0.97);
}
