/*
 * Shared CSS - Common styles for all products
 * Centralizes CSS variables, buttons, cards, and animations
 */

/* ================================
   CSS Variables (Design Tokens)
   ================================ */
:root {
  /* Primary colors */
  --primary: #0f172a;
  --primary-hover: #000000;
  --accent: #6366f1;
  --accent-light: #818cf8;

  /* Semantic colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Background colors */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);

  /* Text colors */
  --text-main: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;

  /* Border colors */
  --border-subtle: #e2e8f0;

  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --blur-glass: blur(12px);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

/* ================================
   Buttons
   ================================ */
.btn-primary {
  background: var(--primary);
  color: white;
  font-weight: 600;
  transition: all 200ms ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  transition: all 200ms ease;
}

.btn-secondary:hover {
  border-color: var(--accent-light);
  color: var(--accent);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-weight: 600;
  transition: all 200ms ease;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-weight: 600;
  transition: all 200ms ease;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ================================
   Cards & Containers
   ================================ */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
}

.card-interactive {
  @apply glass-card rounded-xl p-5 hover:shadow-lg transition-shadow;
}

/* ================================
   Form Elements
   ================================ */
.input-field {
  @apply w-full px-4 py-3 rounded-xl border border-slate-200
         focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500
         transition-all placeholder-slate-400 text-slate-800;
}

.input-field-sm {
  @apply w-full px-3 py-2 rounded-lg border border-slate-200
         focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500
         transition-all placeholder-slate-400 text-slate-800 text-sm;
}

/* ================================
   Icon Containers
   ================================ */
.icon-container {
  @apply w-12 h-12 rounded-xl flex items-center justify-center;
}

.icon-container-lg {
  @apply w-16 h-16 rounded-xl flex items-center justify-center;
}

/* ================================
   Text Utilities
   ================================ */
.text-warning {
  color: var(--warning);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================
   Interactive Elements
   ================================ */
.interactive-row {
  transition: all 200ms ease;
}

.interactive-row:hover {
  background: rgba(99, 102, 241, 0.04);
}

/* ================================
   Animations
   ================================ */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ================================
   Category Badges (Cleanup Product)
   ================================ */
.category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  /* Default background for custom/unknown categories */
  background: #f1f5f9;
  color: #64748b;
}

/* spam -> error (red) */
.category-spam { background: rgba(239, 68, 68, 0.1); color: var(--error); }
/* newsletter -> success (green) */
.category-newsletter { background: rgba(16, 185, 129, 0.1); color: var(--success); }
/* promotional -> warning (yellow/amber) */
.category-promotional { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
/* social -> accent (indigo) */
.category-social { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
/* transactional -> accent (indigo) */
.category-transactional { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
/* important -> accent-light (purple) */
.category-important { background: rgba(129, 140, 248, 0.1); color: var(--accent-light); }
/* old -> neutral slate */
.category-old { background: #f1f5f9; color: #64748b; }
/* unknown -> neutral slate */
.category-unknown { background: #f1f5f9; color: #64748b; }

/* ================================
   Empty State Icon
   ================================ */
.empty-state-icon {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* ================================
   Toast Notifications
   ================================ */
.toast {
  background: var(--bg-surface);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  max-width: 24rem;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--error);
}

/* Toast animations */
@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.animate-slide-up {
  animation: toastSlideUp 0.3s ease-out;
}

.animate-fade-out {
  animation: toastFadeOut 0.3s ease-out forwards;
}

/* ================================
   Details/Summary Element
   ================================ */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details[open] > summary .details-open\:rotate-180 {
  transform: rotate(180deg);
}
