/* ==============================================================================
   STYLES.CSS - DESIGN SYSTEM, VARIÁVEIS, TEMAS DARK / LIGHT E ANIMAÇÕES
   ============================================================================== */

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

:root {
  /* Font Families */
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* Transições Suaves */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.18s var(--ease-smooth);
  --transition-normal: 0.3s var(--ease-smooth);
  --transition-slow: 0.5s var(--ease-smooth);

  /* Border Radius macOS */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
}

/* ==============================================================================
   TEMA DARK (PADRÃO)
   ============================================================================== */
[data-theme="dark"] {
  --bg-desktop: #0b0f19;
  --bg-gradient: radial-gradient(circle at 15% 15%, #1e1b4b 0%, #0f172a 45%, #020617 100%);
  --wallpaper-overlay: rgba(0, 0, 0, 0.35);

  --window-bg: rgba(26, 32, 44, 0.78);
  --window-border: rgba(255, 255, 255, 0.12);
  --window-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);

  --sidebar-bg: rgba(18, 24, 38, 0.65);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(59, 130, 246, 0.22);
  --sidebar-active-text: #60a5fa;

  --card-bg: rgba(30, 41, 59, 0.6);
  --card-hover-bg: rgba(45, 59, 85, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(96, 165, 250, 0.4);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);

  --menubar-bg: rgba(15, 23, 42, 0.75);
  --menubar-border: rgba(255, 255, 255, 0.1);
  --dock-bg: rgba(15, 23, 42, 0.75);
  --dock-border: rgba(255, 255, 255, 0.15);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-invert: #0f172a;

  --input-bg: rgba(15, 23, 42, 0.7);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus-border: #3b82f6;
  --input-focus-ring: rgba(59, 130, 246, 0.25);

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --accent-text: #ffffff;

  --table-header-bg: rgba(15, 23, 42, 0.5);
  --table-row-hover: rgba(255, 255, 255, 0.04);
  --table-border: rgba(255, 255, 255, 0.06);

  --glass-blur: blur(24px);
}

/* ==============================================================================
   TEMA LIGHT (ALTO CONTRASTE E LEGIBILIDADE)
   ============================================================================== */
[data-theme="light"] {
  --bg-desktop: #e8ecf2;
  --bg-gradient: radial-gradient(circle at 10% 10%, #e0e7ff 0%, #f1f5f9 60%, #e2e8f0 100%);
  --wallpaper-overlay: rgba(255, 255, 255, 0.4);

  --window-bg: rgba(255, 255, 255, 0.95);
  --window-border: rgba(0, 0, 0, 0.12);
  --window-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);

  --sidebar-bg: #f8fafc;
  --sidebar-border: rgba(0, 0, 0, 0.1);
  --sidebar-hover: rgba(0, 0, 0, 0.06);
  --sidebar-active: rgba(37, 99, 235, 0.14);
  --sidebar-active-text: #1d4ed8;

  --card-bg: #ffffff;
  --card-hover-bg: #f8fafc;
  --card-border: rgba(0, 0, 0, 0.12);
  --card-hover-border: rgba(37, 99, 235, 0.6);
  --card-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.08);

  --menubar-bg: rgba(255, 255, 255, 0.92);
  --menubar-border: rgba(0, 0, 0, 0.12);
  --dock-bg: rgba(241, 245, 249, 0.94);
  --dock-border: rgba(0, 0, 0, 0.18);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-invert: #ffffff;

  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.18);
  --input-focus-border: #2563eb;
  --input-focus-ring: rgba(37, 99, 235, 0.25);

  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
  --accent-text: #ffffff;

  --table-header-bg: #f1f5f9;
  --table-row-hover: rgba(0, 0, 0, 0.04);
  --table-border: rgba(0, 0, 0, 0.08);

  --glass-blur: blur(24px);
}

/* ==============================================================================
   RESET & BASE
   ============================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-desktop);
  color: var(--text-primary);
  user-select: none;
}

/* Scrollbar Customizada Estilo macOS */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.hidden {
  display: none !important;
}

mark.search-highlight {
  background: rgba(245, 158, 11, 0.35);
  color: inherit;
  padding: 0 3px;
  border-radius: 3px;
}

/* ==============================================================================
   TOAST NOTIFICATIONS (ESTILO NOTIFICAÇÕES MACOS)
   ============================================================================== */
.toast-container {
  position: fixed;
  top: 42px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.mac-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  min-width: 280px;
  max-width: 400px;
  background: var(--menubar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--window-border);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(40px) scale(0.95);
  transition: all 0.3s var(--ease-spring);
  pointer-events: auto;
}

.mac-toast.toast-show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.mac-toast i {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.toast-success i { color: #10b981; }
.toast-info i { color: #3b82f6; }
.toast-warning i { color: #f59e0b; }
.toast-error i { color: #ef4444; }

/* Animações Auxiliares */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake-animation {
  animation: shake 0.45s ease-in-out;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

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