* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Gothic Color Palette */
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);

  /* Dark backgrounds with purple undertones */
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #151520;

  /* Gradient backgrounds */
  --gradient-dark: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 50%, #0f0a15 100%);
  --gradient-card: linear-gradient(145deg, #1a1a24 0%, #12121a 100%);
  --gradient-header: linear-gradient(180deg, #12121a 0%, #0a0a0f 100%);
  --gradient-purple: linear-gradient(135deg, #4c1d95 0%, #7c3aed 50%, #8b5cf6 100%);
  --gradient-crimson: linear-gradient(135deg, #450a0a 0%, #7f1d1d 50%, #991b1b 100%);
  --gradient-button: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);

  /* Text colors */
  --text: #e8e6f0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Accent colors */
  --border: #2d2d3a;
  --border-glow: #4c1d95;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;
  --crimson: #991b1b;

  --radius: 8px;
  --radius-lg: 12px;

  /* Column colors - darker, moodier */
  --column-proposed: #6d28d9;
  --column-todo: #4338ca;
  --column-progress: #b45309;
  --column-testing: #be185d;
  --column-completed: #047857;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gradient-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: auto;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-dark);
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(76, 29, 149, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-ornament {
  width: 200px;
  height: 30px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30'%3E%3Cpath d='M0,15 Q50,0 100,15 Q150,30 200,15' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30'%3E%3Cpath d='M0,15 Q50,0 100,15 Q150,30 200,15' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.login-ornament.top {
  margin-bottom: 20px;
}

.login-ornament.bottom {
  margin-top: 20px;
  transform: rotate(180deg);
}

.login-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 0 60px rgba(139, 92, 246, 0.15),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--gradient-purple);
  border-radius: 2px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.login-subtitle {
  font-family: 'Crimson Text', serif;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.login-form .form-group {
  margin-bottom: 24px;
}

.login-form label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.login-form input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-gothic {
  width: 100%;
  padding: 14px 28px;
  background: var(--gradient-button);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-gothic:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
}

.login-error {
  margin-top: 16px;
  text-align: center;
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 20px;
}

/* ============================================
   MAIN APP
   ============================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--gradient-header);
  border-bottom: 1px solid var(--border);
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}

.header-left {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.logo-subtitle {
  font-family: 'Crimson Text', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-center {
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary {
  padding: 10px 20px;
  background: var(--gradient-button);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--primary);
}

.btn-danger {
  padding: 10px 20px;
  background: var(--gradient-crimson);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(153, 27, 27, 0.4);
}

.btn-logout {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 24px;
  flex: 1;
  overflow-x: auto;
  min-height: 0;
}

.kanban-column {
  flex: 0 0 300px;
  min-width: 300px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.kanban-column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--column-proposed);
  opacity: 0.8;
}

.kanban-column[data-status="proposed"]::before {
  background: linear-gradient(90deg, var(--column-proposed), #9333ea);
}

.kanban-column[data-status="todo"]::before {
  background: linear-gradient(90deg, var(--column-todo), #6366f1);
}

.kanban-column[data-status="in_progress"]::before {
  background: linear-gradient(90deg, var(--column-progress), #d97706);
}

.kanban-column[data-status="testing"]::before {
  background: linear-gradient(90deg, var(--column-testing), #ec4899);
}

.kanban-column[data-status="completed"]::before {
  background: linear-gradient(90deg, var(--column-completed), #10b981);
}

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

.column-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1px;
}

.task-count {
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.column-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.column-content.drag-over {
  background: rgba(139, 92, 246, 0.1);
  box-shadow: inset 0 0 30px rgba(139, 92, 246, 0.1);
}

/* ============================================
   TASK CARD
   ============================================ */
.task-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: grab;
  transition: all 0.3s ease;
  position: relative;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.task-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 20px var(--primary-glow);
}

.task-card:hover::before {
  opacity: 1;
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  word-break: break-word;
}

.task-priority {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.task-priority.high {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(153, 27, 27, 0.3));
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.task-priority.medium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(180, 83, 9, 0.3));
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.task-priority.low {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(4, 120, 87, 0.3));
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.task-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.task-tag.category {
  color: white;
  border: none;
}

.task-tag.due-date.overdue {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(153, 27, 27, 0.2));
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.3);
}

/* Empty Column */
.empty-column {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 0 60px rgba(139, 92, 246, 0.2),
    0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 2px;
  background: var(--gradient-purple);
  border-radius: 2px;
}

.modal-small {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 1px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.3s ease;
}

.btn-close:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.category-item:hover {
  border-color: var(--primary);
}

.category-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.category-name {
  flex: 1;
  font-size: 0.9rem;
}

.category-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.3s ease;
}

.category-delete:hover {
  color: var(--danger);
  transform: scale(1.2);
}

.category-form {
  display: flex;
  gap: 10px;
}

.category-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.category-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.category-form input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 2px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header-left {
    flex-direction: column;
    gap: 4px;
  }

  .header-center {
    order: 3;
    flex: 0 0 100%;
    max-width: none;
  }

  .kanban-board {
    padding: 16px;
  }

  .kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
  }

  .form-row {
    flex-direction: column;
  }

  .login-card {
    padding: 32px 24px;
    margin: 0 16px;
  }

  .login-title {
    font-size: 2rem;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--bg-tertiary), var(--border));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--border), var(--primary));
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
  50% { box-shadow: 0 0 40px var(--primary-glow); }
}

.login-card {
  animation: fadeIn 0.5s ease-out;
}

.task-card {
  animation: fadeIn 0.3s ease-out;
}
