/* Light / Dark Mode Core Styling */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Default: Light Theme */
:root {
  --bg-color: #f8fafc; /* Slate 50 */
  --text-color: #334155; /* Slate 700 */
  --text-heading: #0f172a; /* Slate 900 */
  --panel-bg: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(226, 232, 240, 0.8); /* Slate 200 */
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(226, 232, 240, 0.6);
  --input-bg: #ffffff;
  --input-border: #cbd5e1; /* Slate 300 */
  --input-text: #0f172a;
  --sidebar-hover: rgba(241, 245, 249, 0.9);
  --sidebar-active: rgba(99, 102, 241, 0.1);
  --stat-label: #64748b; /* Slate 500 */
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --panel-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Dark Theme Overrides */
html.dark {
  --bg-color: #090d16; /* Darker Slate */
  --text-color: #94a3b8; /* Slate 400 */
  --text-heading: #f8fafc; /* Slate 50 */
  --panel-bg: rgba(15, 23, 42, 0.75); /* Slate 900 */
  --panel-border: rgba(255, 255, 255, 0.07);
  --card-bg: rgba(30, 41, 59, 0.4); /* Slate 800 */
  --card-border: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(15, 23, 42, 0.8);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-text: #f8fafc;
  --sidebar-hover: rgba(30, 41, 59, 0.5);
  --sidebar-active: rgba(99, 102, 241, 0.15);
  --stat-label: #94a3b8;
  --card-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.4);
  --panel-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
}

/* Glassmorphism Styles */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4); /* Indigo 500 */
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.15);
}

html.dark .glass-card:hover {
  box-shadow: 0 12px 20px -8px rgba(99, 102, 241, 0.3);
}

.glass-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  transition: all 0.2s ease-in-out;
}

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

/* Sidebar Nav States */
.sidebar-link {
  color: var(--text-color);
  transition: all 0.2s ease;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--text-heading);
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: #6366f1; /* Indigo 500 */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--input-border);
  border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Status Badges */
.badge-pending {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
html.dark .badge-pending {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.badge-progress {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
html.dark .badge-progress {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-submitted {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
html.dark .badge-submitted {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.badge-completed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
html.dark .badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-revision {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
html.dark .badge-revision {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Stat Sub-Labels */
.stat-subtext {
  color: var(--stat-label);
}

/* Logo Styling based on light/dark theme */
.theme-logo {
  transition: filter 0.3s ease;
}
html.dark .theme-logo {
  /* Invert black to white, while preserving the color of the green 'X' */
  filter: invert(1) hue-rotate(180deg);
}
