@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --color-primary: #0f766e;
  --color-primary-light: #14b8a6;
  --color-secondary: #0f172a;

  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-2xl: 1.5rem;

  --transition-fast: 0.15s ease-in-out;
}

body {
  font-family: 'Inter', sans-serif;
  color: #1e293b;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body>main {
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bg-gradient {
  background: linear-gradient(-45deg, #f8fafc, #e0e7ff, #eff6ff, #f1f5f9);
  background-size: 400% 400%;
  animation: bgGradientAnim 20s ease infinite;
  background-attachment: fixed;
}

@keyframes bgGradientAnim {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.glass-header {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.card {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.04), 0 0 1px rgba(15, 23, 42, 0.1);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 48px -4px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.15);
  border-color: rgba(255, 255, 255, 1);
  transform: translateY(-4px) scale(1.005);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background-color: var(--color-primary);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px -2px rgba(15, 118, 110, 0.3);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.5s ease-out;
}

.btn-primary:hover::after {
  opacity: 1;
  transform: scale(1);
}

.btn-primary:hover {
  background-color: var(--color-primary-light);
  box-shadow: 0 10px 25px -4px rgba(20, 184, 166, 0.5), 0 0 0 2px rgba(20, 184, 166, 0.1);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.nav-item:hover {
  background-color: white;
  color: #0f172a;
}

.nav-item-active {
  background-color: #f0fdfa;
  color: var(--color-primary-light);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.1);
}

.stat-card {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.04);
}

.stat-card .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-card h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
}

.stat-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 48px -4px rgba(15, 23, 42, 0.08);
}
/* ==================== DARK MODE GLOBALS ==================== */
html.dark body {
    background-color: #0f172a !important; /* Tailwind slate-900 */
    color: #cbd5e1 !important; /* default text */
}

/* Hide the light gradient background */
html.dark .bg-gradient {
    display: none !important;
}

/* Base structural overrides */
html.dark .card, 
html.dark .glass-card, 
html.dark .stat-card, 
html.dark .kanban-col {
    background: rgba(30, 41, 59, 0.7) !important; /* slate-800 */
    border-color: rgba(255,255,255,0.05) !important;
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.5) !important;
}

html.dark .glass-header {
    background: rgba(15, 23, 42, 0.8) !important; /* slate-900 */
    border-bottom-color: rgba(255,255,255,0.05) !important;
}

/* Fix text colors globally */
html.dark h1, html.dark h2, html.dark h3, html.dark h4, 
html.dark .text-slate-900, html.dark .text-slate-800 { 
    color: #f8fafc !important; 
}
html.dark p, html.dark .text-slate-700, html.dark .text-slate-600 { 
    color: #e2e8f0 !important; 
}
html.dark span, html.dark .text-slate-500, html.dark .text-slate-400 { 
    color: #94a3b8 !important; 
}

/* Table overrides */
html.dark table thead th, html.dark table thead tr { color: #94a3b8 !important; background-color: transparent !important; }
html.dark tr:hover td { background-color: rgba(255,255,255,0.02) !important; }

/* Backgrounds & borders for tiny elements */
html.dark .bg-white, html.dark .bg-slate-50, html.dark .bg-slate-100 {
    background-color: rgba(30, 41, 59, 0.4) !important;
    border-color: rgba(255,255,255,0.05) !important;
}

html.dark .border-slate-100, html.dark .border-slate-200 { border-color: rgba(255,255,255,0.05) !important; }

/* Inputs and Forms */
html.dark input[type="text"], html.dark input[type="email"], html.dark input[type="password"], html.dark select {
    background-color: rgba(15, 23, 42, 0.6) !important;
    color: #f8fafc !important;
    border-color: rgba(255,255,255,0.1) !important;
}
html.dark input::placeholder { color: #64748b !important; }

/* Status Badges */
html.dark .bg-amber-100 { background-color: rgba(245, 158, 11, 0.2) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.1) !important; }
html.dark .bg-teal-100 { background-color: rgba(20, 184, 166, 0.2) !important; color: #5eead4 !important; border-color: rgba(20, 184, 166, 0.1) !important; }
html.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.2) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.1) !important; }
html.dark .bg-slate-100 { background-color: rgba(30, 41, 59, 0.5) !important; color: #cbd5e1 !important; }

/* Keep standard colors bright */
html.dark .text-teal-700, html.dark .text-primary { color: #2dd4bf !important; }
html.dark .bg-teal-50 { background-color: rgba(20, 184, 166, 0.1) !important; }

/* ==================== PDF PRINT RULES ==================== */
@media print {
    @page { margin: 1cm; size: A4 landscape; }
    body, html.dark body { 
        background: white !important; 
        color: black !important; 
    }
    .glass-header, .btn-primary, .btn-secondary, form, nav, button, #toast-container, #print-btn { 
        display: none !important; 
    }
    .card, .stat-card, .kanban-col {
        break-inside: avoid;
        border: 1px solid #cbd5e1 !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    * { 
        text-shadow: none !important; 
        box-shadow: none !important; 
    }
    .text-slate-900, .text-slate-800, html.dark .text-slate-900, html.dark .text-slate-800 { color: black !important; }
    .text-slate-500, html.dark .text-slate-500 { color: #475569 !important; }
    .bg-gradient { display: none !important; }
    
    /* Make kanban fit on page */
    .kanban-col { min-width: 0 !important; max-height: none !important; padding: 10px !important; }
    .kanban-dropzone { min-height: 0 !important; }
}
