/* Reset and Globals */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
  --bg: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 50%, #151e33 0%, #0b0f19 100%);
  --panel: rgba(22, 28, 45, 0.45);
  --panel-hover: rgba(22, 28, 45, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.3);
  
  --color-queue: #c084fc;
  --color-today: #fbbf24;
  --color-done: #34d399;
  
  /* Domain colors */
  --dom-msd: #60a5fa;
  --dom-dlsmhsi: #f472b6;
  --dom-kdp: #fb923c;
  --dom-personal: #a78bfa;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

/* Glassmorphism panel base */
.glass-panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2.25rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.header-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header-logo h1 span {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
  filter: brightness(1.1);
}

.btn-primary:disabled, .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.profile-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

/* Stats Container */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
}

.stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.pending-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.completed-icon {
  background: rgba(52, 211, 153, 0.15);
  color: var(--color-done);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.rate-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Main Workspace */
.main-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-workspace {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar {
  padding: 1.5rem;
}

.sidebar h3 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.filter-btn.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--text);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding-left: 0.8125rem;
}

.domain-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  display: inline-block;
}

.all-dot { background: var(--text); }
.msd-dot { background: var(--dom-msd); }
.dlsmhsi-dot { background: var(--dom-dlsmhsi); }
.kdp-dot { background: var(--dom-kdp); }
.personal-dot { background: var(--dom-personal); }

.sidebar-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.system-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.sys-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.sys-row span:last-child {
  color: var(--text);
  font-weight: 500;
}

.status-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.live {
  background: rgba(52, 211, 153, 0.15);
  color: var(--color-done);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  padding: 1.25rem;
  min-height: 600px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.column-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.color-queue { color: var(--color-queue); }
.color-today { color: var(--color-today); }
.color-done { color: var(--color-done); }

.col-count {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Card Styling */
.task-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.4);
  background: var(--panel-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.domain-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.tag-msd { background: rgba(96, 165, 250, 0.15); color: var(--dom-msd); border: 1px solid rgba(96, 165, 250, 0.2); }
.tag-dlsmhsi { background: rgba(244, 114, 182, 0.15); color: var(--dom-dlsmhsi); border: 1px solid rgba(244, 114, 182, 0.2); }
.tag-kdp { background: rgba(251, 146, 60, 0.15); color: var(--dom-kdp); border: 1px solid rgba(251, 146, 60, 0.2); }
.tag-personal { background: rgba(167, 139, 250, 0.15); color: var(--dom-personal); border: 1px solid rgba(167, 139, 250, 0.2); }

.type-icon {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.due-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.due-info i {
  font-size: 0.85rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.done-btn:hover {
  color: var(--color-done);
  background: rgba(52, 211, 153, 0.1);
}

.delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

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

.task-card {
  animation: fadeIn 0.4s ease forwards;
}

.no-tasks {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  margin: 1rem 0;
}

/* Quick Single Input Container */
.quick-input-container {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0.65rem 1.25rem;
  margin-bottom: 1.75rem;
  border-radius: 14px;
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.35);
  background: rgba(18, 24, 38, 0.9);
  transform: translateY(-1px);
}

.input-magic-icon {
  color: var(--accent);
  font-size: 1.15rem;
  margin-right: 0.85rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

#task-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  padding: 0.4rem 0;
  font-family: inherit;
  width: 100%;
}

#task-input::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
}

.input-right-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.enter-badge kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: inherit;
  letter-spacing: 0.02em;
  user-select: none;
}

.input-status {
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  animation: fadeIn 0.3s ease;
}

.input-status.loading {
  color: var(--accent);
  background: rgba(6, 182, 212, 0.12);
}

.input-status.success {
  color: var(--color-done);
  background: rgba(52, 211, 153, 0.12);
}

.input-status.error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.hidden {
  display: none !important;
}

/* Card Pulse / Flow Animation for Newly Created Tasks */
@keyframes highlightGlow {
  0% {
    box-shadow: 0 0 0 0 var(--accent-glow);
    border-color: var(--accent);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 20px 4px var(--accent-glow);
    border-color: var(--accent);
    transform: scale(1.02);
  }
  100% {
    box-shadow: none;
    border-color: var(--border);
    transform: scale(1);
  }
}

.card-highlight {
  animation: highlightGlow 2.5s ease-out forwards;
}

/* Auth Modal Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  transition: opacity 0.3s ease;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  border-radius: 1.25rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(59, 130, 246, 0.15);
  border: 1px solid var(--border-hover);
  animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.auth-icon-wrapper {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon {
  font-size: 1.75rem;
  color: var(--accent);
}

.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.auth-input-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.auth-input-group i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-input-group input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.auth-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
}

.auth-error {
  margin-top: 1rem;
  padding: 0.65rem;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
