/* =====================================================================
   TODO-APP — CSS: APP.CSS
   Linear / Raycast / Supabase Navy Glass Aesthetic & Micro-Interactions
   ===================================================================== */

:root {
  /* Obsidian & Navy Glass Color Tokens */
  --bg-deep: #050811;
  --bg-base: #090e1c;
  --bg-surface-1: #0e1628;
  --bg-surface-2: #141f36;
  --bg-surface-3: #1a2845;
  
  --glass-bg: rgba(14, 22, 40, 0.68);
  --glass-bg-hover: rgba(20, 31, 54, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(59, 130, 246, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* Priority Tokens */
  --priority-urgent-bg: rgba(244, 63, 94, 0.12);
  --priority-urgent-border: rgba(244, 63, 94, 0.35);
  --priority-urgent-text: #fb7185;

  --priority-medium-bg: rgba(6, 182, 212, 0.12);
  --priority-medium-border: rgba(6, 182, 212, 0.35);
  --priority-medium-text: #22d3ee;

  --priority-low-bg: rgba(16, 185, 129, 0.12);
  --priority-low-border: rgba(16, 185, 129, 0.35);
  --priority-low-text: #34d399;
}

/* Base Body & Layout */
body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 15% 15%, rgba(37, 99, 235, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 25%, rgba(6, 182, 212, 0.08) 0px, transparent 45%),
    radial-gradient(at 50% 85%, rgba(139, 92, 246, 0.07) 0px, transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%);
  background-attachment: fixed;
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Ultra-Slim Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  pointer-events: none;
}

.glass-card {
  background: rgba(14, 22, 40, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), 0 0 16px -2px rgba(59, 130, 246, 0.22);
}

.task-item {
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task-item:hover {
  background: var(--glass-bg-hover) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Button & Interactive states */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.18s ease;
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-glass:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.35);
  transition: all 0.18s ease;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

/* Form Inputs & Custom Selects */
.input-glass {
  background: rgba(10, 15, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  outline: none;
  transition: all 0.18s ease;
}
.input-glass:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(10, 15, 29, 0.95);
}

/* Custom Select Dropdown with Chevron */
select.input-glass, .custom-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem 1rem;
  padding-right: 2rem !important;
  cursor: pointer;
}
select.input-glass option, .custom-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
}

/* Task Checkbox & Strikethrough Animation */
.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  background: rgba(14, 22, 40, 0.7);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  flex-shrink: 0;
}
.custom-checkbox:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.06);
}
.custom-checkbox:checked {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}
.custom-checkbox:checked::after {
  content: '';
  width: 4.5px;
  height: 8.5px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -1px);
  display: block;
}

/* Button Icon Pill (32x32px square rounded-lg, centered SVG icon) */
.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.18s ease;
  flex-shrink: 0;
  cursor: pointer;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.btn-icon-edit:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}
.btn-icon-delete:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}
.btn-icon:active {
  transform: translateY(0);
}

/* Quick Status Selector Dropdown */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.8rem 0.8rem;
  padding-right: 1.75rem !important;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.18s ease;
  cursor: pointer;
  outline: none;
}
.status-select:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
.status-select-todo {
  background-color: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
}
.status-select-todo:hover {
  border-color: rgba(100, 116, 139, 0.5);
  background-color: rgba(100, 116, 139, 0.25);
}
.status-select-in-progress {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.status-select-in-progress:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background-color: rgba(245, 158, 11, 0.25);
}
.status-select-review {
  background-color: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}
.status-select-review:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background-color: rgba(168, 85, 247, 0.25);
}
.status-select-done {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.status-select-done:hover {
  border-color: rgba(16, 185, 129, 0.6);
  background-color: rgba(16, 185, 129, 0.25);
}
.status-select option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 6px 10px;
}

/* Task Item States */
.task-item {
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.task-item.task-done {
  opacity: 0.58;
  background: rgba(10, 15, 29, 0.4);
}
.task-item.task-done:hover {
  opacity: 0.85;
}

.task-title-text {
  position: relative;
  display: inline-block;
  transition: color 0.2s ease;
}

.task-done .task-title-text {
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-color: #64748b;
  text-decoration-thickness: 1.5px;
}

/* Priority Glow Badges */
.badge-urgent {
  background: var(--priority-urgent-bg);
  border: 1px solid var(--priority-urgent-border);
  color: var(--priority-urgent-text);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

.badge-medium {
  background: var(--priority-medium-bg);
  border: 1px solid var(--priority-medium-border);
  color: var(--priority-medium-text);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.badge-low {
  background: var(--priority-low-bg);
  border: 1px solid var(--priority-low-border);
  color: var(--priority-low-text);
}

.badge-urgent svg,
.badge-medium svg,
.badge-low svg,
.status-todo svg,
.status-in-progress svg,
.status-review svg,
.status-done svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Status Chips */
.status-todo {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #cbd5e1;
}
.status-in-progress {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  animation: pulse-border 2s infinite;
}
.status-review {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}
.status-done {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(245, 158, 11, 0.35); }
  50% { border-color: rgba(245, 158, 11, 0.7); }
}

/* Drag & Drop Styling */
.draggable-card {
  cursor: grab;
  user-select: none;
}
.draggable-card:active {
  cursor: grabbing;
}
.draggable-card.dragging {
  opacity: 0.45;
  transform: rotate(2deg) scale(0.98);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);
  border-color: #3b82f6 !important;
}

.drop-zone {
  min-height: 120px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.drop-zone.drag-over {
  background: rgba(59, 130, 246, 0.08) !important;
  border: 2px dashed #3b82f6 !important;
  border-radius: 0.75rem;
}

/* Kanban Board Columns */
.kanban-col {
  background: rgba(14, 22, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.875rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 520px;
}

.kanban-col-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 15, 29, 0.4);
  border-top-left-radius: 0.875rem;
  border-top-right-radius: 0.875rem;
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.875rem;
  gap: 0.75rem;
  display: flex;
  flex-direction: column;
}

/* Progress bar fill */
.progress-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  height: 5px;
}
.progress-track-sm {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  height: 4px;
  width: 48px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 50%, #10b981 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keyboard Shortcut Badge */
kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-width: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}

/* Modal and Drawers */
.modal-backdrop {
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s ease;
}

.modal-content {
  background: #0f172a;
  background-image: linear-gradient(180deg, #131d33 0%, #0d1527 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.97);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.modal-backdrop.open .modal-content {
  transform: scale(1);
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  background: rgba(14, 22, 40, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slide-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.25s ease;
}

@keyframes slide-in {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast.toast-error { border-color: rgba(244, 63, 94, 0.4); }
.toast.toast-info { border-color: rgba(59, 130, 246, 0.4); }

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}
