/* ═══════════════════════════════════════════════════════════════════════════════
   LIQUID GLASS THEME — macOS 26 Tahoe Inspired

   Premium glassmorphism UI with frosted panels, depth, and subtle animations.
   Apply this theme by adding it to index.html and toggling .liquid-glass class
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────── CSS VARIABLES ─────────────────────────────────── */
:root.liquid-glass {
  /* Backdrop / Glass */
  --glass-blur: 20px;
  --glass-saturate: 180%;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
  --glass-inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.15);

  /* Dark mode colors: deep navy → purple → teal */
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1425;
  --bg-tertiary: #141c2a;
  --accent-purple: #5b21b6;
  --accent-blue: #1e40af;
  --accent-teal: #0d7377;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;

  /* Component colors */
  --status-done: rgba(34, 197, 94, 0.15);
  --status-done-border: rgba(34, 197, 94, 0.4);
  --status-progress: rgba(59, 130, 246, 0.15);
  --status-progress-border: rgba(59, 130, 246, 0.4);
  --status-todo: rgba(156, 163, 175, 0.15);
  --status-todo-border: rgba(156, 163, 175, 0.4);
  --status-blocked: rgba(239, 68, 68, 0.15);
  --status-blocked-border: rgba(239, 68, 68, 0.4);
}

/* ─────────────────────────────────── ANIMATED GRADIENT BACKGROUND ─────────────────────────────── */
body.liquid-glass {
  position: relative;
  overflow-x: hidden;
}

body.liquid-glass::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    #0a0e1a 0%,
    #1a0a2e 25%,
    #0a1a2e 50%,
    #1a1a0e 75%,
    #0a0e1a 100%
  );
  background-size: 400% 400%;
  animation: liquid-shift 25s ease-in-out infinite;
  z-index: -1;
  filter: blur(40px) saturate(120%);
  opacity: 0.6;
}

@keyframes liquid-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ─────────────────────────────────── GLOBAL OVERRIDES ─────────────────────────────── */
body.liquid-glass {
  background: var(--bg-primary);
  color: var(--text-primary);
}

body.liquid-glass .dark {
  color-scheme: dark;
}

/* Remove default backgrounds and let glass shine */
body.liquid-glass .bg-white {
  background: transparent;
}

body.liquid-glass .dark\:bg-gray-800,
body.liquid-glass .dark\:bg-gray-900 {
  background: transparent;
}

/* ─────────────────────────────────── SIDEBAR ─────────────────────────────── */
body.liquid-glass #sidebar {
  background: linear-gradient(
    135deg,
    rgba(20, 28, 42, 0.4),
    rgba(10, 26, 46, 0.3)
  ) !important;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-right: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow),
    var(--glass-inset-light);
}

body.liquid-glass #sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(91, 33, 182, 0.1) 0%,
    transparent 50%,
    rgba(13, 115, 119, 0.1) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

body.liquid-glass #sidebar > * {
  position: relative;
  z-index: 1;
}

/* Sidebar borders */
body.liquid-glass #sidebar .border-gray-200,
body.liquid-glass #sidebar .dark\:border-gray-700 {
  border-color: var(--glass-border) !important;
}

/* Sidebar logo */
body.liquid-glass #sidebar-logo {
  background: linear-gradient(135deg, #93c5fd, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Sidebar links */
body.liquid-glass .sidebar-link {
  color: var(--text-secondary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

body.liquid-glass .sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #93c5fd, #a78bfa);
  transform: translateX(-3px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.liquid-glass .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateX(2px);
}

body.liquid-glass .sidebar-link:hover::before {
  transform: translateX(0);
}

body.liquid-glass .sidebar-link.active {
  background: rgba(147, 197, 253, 0.15);
  color: #93c5fd;
  font-weight: 600;
}

body.liquid-glass .sidebar-link.active::before {
  transform: translateX(0);
}

/* ─────────────────────────────────── HEADER ─────────────────────────────── */
body.liquid-glass header {
  background: rgba(10, 14, 26, 0.3) !important;
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    var(--glass-inset-light);
}

/* ─────────────────────────────────── MAIN CONTENT CARDS ─────────────────────────────── */
body.liquid-glass .bg-white.dark\:bg-gray-800,
body.liquid-glass .bg-gray-100.dark\:bg-gray-800,
body.liquid-glass .bg-blue-50.dark\:bg-blue-900\\/20,
body.liquid-glass .bg-red-50.dark\:bg-red-900\\/20,
body.liquid-glass .bg-green-50.dark\:bg-green-900\\/20 {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  ) !important;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border) !important;
  box-shadow:
    var(--glass-shadow),
    var(--glass-inset-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.liquid-glass .rounded-lg {
  border-radius: 16px;
}

body.liquid-glass .rounded-md {
  border-radius: 12px;
}

/* Card hover effect */
body.liquid-glass .bg-white.dark\:bg-gray-800:hover,
body.liquid-glass .bg-gray-100.dark\:bg-gray-800:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    var(--glass-inset-light);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Remove shadow classes */
body.liquid-glass .shadow {
  box-shadow:
    var(--glass-shadow),
    var(--glass-inset-light) !important;
}

/* ─────────────────────────────────── BUTTONS ─────────────────────────────── */
body.liquid-glass button,
body.liquid-glass .btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Primary buttons */
body.liquid-glass .bg-primary-600,
body.liquid-glass .bg-primary-700 {
  background: linear-gradient(135deg, #3b82f6, #1e40af) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 15px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: white;
}

body.liquid-glass .bg-primary-600:hover,
body.liquid-glass .bg-primary-700:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.liquid-glass .bg-primary-600::after,
body.liquid-glass .bg-primary-700::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
  opacity: 0;
}

body.liquid-glass .bg-primary-600:hover::after,
body.liquid-glass .bg-primary-700:hover::after {
  opacity: 1;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Secondary buttons */
body.liquid-glass .bg-gray-200.dark\:bg-gray-700,
body.liquid-glass .bg-gray-100.dark\:bg-gray-700 {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.liquid-glass .bg-gray-200.dark\:bg-gray-700:hover,
body.liquid-glass .bg-gray-100.dark\:bg-gray-700:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Filter buttons */
body.liquid-glass .filter-btn,
body.liquid-glass .assignee-btn,
body.liquid-glass .project-filter-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

/* ─────────────────────────────────── INPUTS & TEXTAREAS ─────────────────────────────── */
body.liquid-glass input,
body.liquid-glass textarea,
body.liquid-glass select {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border) !important;
  color: var(--text-primary) !important;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.liquid-glass input::placeholder,
body.liquid-glass textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.liquid-glass input:focus,
body.liquid-glass textarea:focus,
body.liquid-glass select:focus {
  border-color: rgba(147, 197, 253, 0.5) !important;
  box-shadow:
    0 0 0 3px rgba(147, 197, 253, 0.1),
    var(--glass-inset-light) !important;
  outline: none;
}

/* ─────────────────────────────────── TASK CARDS ─────────────────────────────── */
body.liquid-glass .task-card,
body.liquid-glass [class*="task"] {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  ) !important;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    var(--glass-inset-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

body.liquid-glass .task-card:hover,
body.liquid-glass [class*="task"]:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.3),
    var(--glass-inset-light);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Status-based task card borders */
body.liquid-glass .task-done {
  border-left: 3px solid var(--status-done-border) !important;
}

body.liquid-glass .task-in_progress {
  border-left: 3px solid var(--status-progress-border) !important;
}

body.liquid-glass .task-todo {
  border-left: 3px solid var(--status-todo-border) !important;
}

body.liquid-glass .task-blocked {
  border-left: 3px solid var(--status-blocked-border) !important;
}

/* ─────────────────────────────────── BADGES & PILLS ─────────────────────────────── */
body.liquid-glass .rounded-full {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(8px);
  color: var(--text-primary);
}

body.liquid-glass .bg-gray-700.text-white,
body.liquid-glass .bg-green-600,
body.liquid-glass .bg-blue-600,
body.liquid-glass .bg-red-600,
body.liquid-glass .bg-yellow-600 {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08)) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(8px);
  color: var(--text-primary);
}

/* Priority badges */
body.liquid-glass .priority-high {
  border-left: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.1) !important;
}

body.liquid-glass .priority-medium {
  border-left: 2px solid #f59e0b;
  background: rgba(245, 158, 11, 0.1) !important;
}

body.liquid-glass .priority-low {
  border-left: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.1) !important;
}

/* ─────────────────────────────────── MODALS & DIALOGS ─────────────────────────────── */
body.liquid-glass .modal,
body.liquid-glass .dialog,
body.liquid-glass [role="dialog"] {
  background: linear-gradient(135deg, rgba(15, 20, 37, 0.95), rgba(10, 14, 26, 0.95)) !important;
  backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    var(--glass-inset-light);
  border-radius: 20px;
}

/* Modal appearance animation */
@keyframes modal-open {
  from {
    transform: scale(0.96) translateY(-10px);
    opacity: 0;
    filter: blur(8px);
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

body.liquid-glass .modal,
body.liquid-glass .dialog,
body.liquid-glass [role="dialog"] {
  animation: modal-open 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ─────────────────────────────────── PROGRESS BARS & INDICATORS ─────────────────────────────── */
body.liquid-glass .progress,
body.liquid-glass [role="progressbar"] {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.liquid-glass .progress-fill,
body.liquid-glass [role="progressbar"] > * {
  background: linear-gradient(
    90deg,
    #3b82f6,
    #a78bfa,
    #3b82f6
  );
  background-size: 200% 100%;
  animation: gradient-flow 3s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

@keyframes gradient-flow {
  0% {
    background-position: 200% center;
  }
  50% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ─────────────────────────────────── TEXT SELECTIONS ─────────────────────────────── */
body.liquid-glass ::selection {
  background: rgba(147, 197, 253, 0.3);
  color: var(--text-primary);
}

/* ─────────────────────────────────── BORDERS & SEPARATORS ─────────────────────────────── */
body.liquid-glass .border,
body.liquid-glass .border-b,
body.liquid-glass .border-r,
body.liquid-glass .border-l,
body.liquid-glass .border-t {
  border-color: var(--glass-border) !important;
}

body.liquid-glass .border-gray-200,
body.liquid-glass .dark\:border-gray-700 {
  border-color: var(--glass-border) !important;
}

body.liquid-glass .border-l-4 {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ─────────────────────────────────── SCROLLBARS ─────────────────────────────── */
body.liquid-glass ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.liquid-glass ::-webkit-scrollbar-track {
  background: transparent;
}

body.liquid-glass ::-webkit-scrollbar-thumb {
  background: rgba(147, 197, 253, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

body.liquid-glass ::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 197, 253, 0.5);
}

/* ─────────────────────────────────── HOVER STATES ─────────────────────────────── */
body.liquid-glass a {
  color: #93c5fd;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.liquid-glass a:hover {
  color: #bfdbfe;
  text-shadow: 0 0 10px rgba(147, 197, 253, 0.3);
}

/* ─────────────────────────────────── THEME TOGGLE BUTTON ─────────────────────────────── */
#theme-toggle-glass {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #a78bfa);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 24px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
}

#theme-toggle-glass:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow:
    0 12px 32px rgba(59, 130, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#theme-toggle-glass:active {
  transform: scale(0.98);
}

/* ─────────────────────────────────── UTILITY: GLASS CLASS APPLIER ─────────────────────────────── */
body.liquid-glass h1,
body.liquid-glass h2,
body.liquid-glass h3,
body.liquid-glass h4,
body.liquid-glass h5,
body.liquid-glass h6 {
  color: var(--text-primary);
}

body.liquid-glass p,
body.liquid-glass span,
body.liquid-glass label {
  color: var(--text-secondary);
}

body.liquid-glass .text-gray-500,
body.liquid-glass .dark\:text-gray-400,
body.liquid-glass .text-gray-600,
body.liquid-glass .dark\:text-gray-300 {
  color: var(--text-secondary) !important;
}

body.liquid-glass .text-gray-700,
body.liquid-glass .dark\:text-gray-200 {
  color: var(--text-primary) !important;
}

/* Light mode text color fixes */
body.liquid-glass .text-gray-900 {
  color: var(--text-primary) !important;
}

/* Brand color consistency */
body.liquid-glass .text-primary-600,
body.liquid-glass .text-primary-400 {
  color: #93c5fd !important;
}

/* ─────────────────────────────────── RESPONSIVE ADJUSTMENTS ─────────────────────────────── */
@media (max-width: 768px) {
  #theme-toggle-glass {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}
