:root {
  --bg-color: #0d1117;
  --text-color: #e6edf3;
  --text-secondary: #8b949e;
  --column-bg: rgba(22, 27, 34, 0.6);
  --card-bg: rgba(33, 38, 45, 0.95);
  --primary-color: #58a6ff;
  --success-color: #238636;
  --danger-color: #da3633;
  --warning-color: #d29922;
  --glass-border: rgba(240, 246, 252, 0.1);
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.4);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  background-image: 
    radial-gradient(at 0% 0%, rgba(88, 166, 255, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(210, 153, 34, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Header Actions Overflow Fix */
.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

input[type="text"], input[type="date"], select, textarea {
  width: 100%; padding: 0.8rem; border-radius: 8px; border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2); color: var(--text-color); font-family: inherit; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; margin-right: 4px; }
.badge-low { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-medium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-high { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-date { background: rgba(107, 114, 128, 0.2); color: #d1d5db; text-transform: none; }
.badge-tag { background: rgba(139, 92, 246, 0.2); color: #a78bfa; text-transform: lowercase; }
.task-metadata-bar { margin-bottom: 0.5rem; }

/* Header */
header {
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.7);
}

h1 {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  background: #010409;
  padding: 4px 6px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); 
}

/* Toolbar Buttons Overrides */
.header-actions .btn-secondary, 
.header-actions .btn-danger-outline {
  background: transparent;
  border: none;
  border-radius: 30px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.header-actions .btn-secondary:hover,
.header-actions .btn-danger-outline:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-color);
  box-shadow: none;
  transform: none;
}

.header-actions .btn-primary {
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  box-shadow: none;
  margin-left: 0.5rem;
}

/* Buttons */
button {
  font-family: inherit;
}

#add-task-btn, .btn-primary {
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}

#add-task-btn:hover, .btn-primary:hover {
  background: #2ea043;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(35, 134, 54, 0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-color);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: #ff7b72;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-danger-outline:hover {
  background: rgba(218, 54, 51, 0.1);
  border-color: var(--danger-color);
}

/* Board Layout */
main {
  padding: 2rem 3rem;
  overflow-x: auto;
  height: calc(100vh - 80px);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 1.5rem;
  height: 100%;
}

/* ... */

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
    min-width: unset;
  }
}

.column {
  background: var(--column-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s;
  max-height: 100%;
}

.column-header {
  padding: 1.2rem;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
}

.count {
  background: rgba(110, 118, 129, 0.4);
  padding: 0.1rem 0.6rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tasks-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Task Card */
.task-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: grab;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  border-left: 4px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  background: #21262d;
  border-color: rgba(88, 166, 255, 0.3);
}

.task-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: none;
  border: 2px dashed var(--primary-color);
  background: transparent;
}

.task-content {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  font-weight: 400;
  word-wrap: break-word;
}

/* unique Timer Design */
.task-timer {
  background: #090c10;
  padding: 0.4rem 0.6rem;
  border-radius: 50px; /* Capsule shape */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #30363d;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); /* Deep inset look */
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-timer.is-running {
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.8),
    0 0 15px rgba(88, 166, 255, 0.15);
  background: linear-gradient(90deg, #0d1117, #161b22);
}

/* Subtle moving glow for running timer */
.task-timer.is-running::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, rgba(88, 166, 255, 0.1), transparent 30%);
  animation: rotate-sheen 4s linear infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes rotate-sheen {
  100% { transform: rotate(360deg); }
}

.timer-display {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  font-size: 1rem;
  color: #8b949e;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0.5rem;
  transition: color 0.3s;
}

.task-timer.is-running .timer-display {
  color: #58a6ff;
  text-shadow: 0 0 8px rgba(88, 166, 255, 0.4);
}

.recording-dot {
  width: 8px;
  height: 8px;
  background-color: #f78166;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #f78166;
  animation: blink-dot 1s infinite ease-in-out;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.timer-controls {
  display: flex;
  gap: 4px;
  z-index: 2;
  background: rgba(255,255,255,0.03);
  padding: 3px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.05);
}

.timer-btn, .view-logs-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.timer-btn:hover, .view-logs-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: scale(1.1);
}

.start-btn:hover {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
  box-shadow: 0 0 10px rgba(35, 134, 54, 0.2);
}

.pause-btn:hover {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
  box-shadow: 0 0 10px rgba(210, 153, 34, 0.2);
}

.view-logs-btn:hover {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
}

/* Meta Footer */
.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: auto;
}

.task-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

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

.task-actions button {
  padding: 4px 6px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.task-actions button:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-color);
}

.delete-btn:hover {
  color: var(--danger-color) !important;
  background: rgba(218, 54, 51, 0.1) !important;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #161b22;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  width: 100%;
}

.modal-header h2 {
  margin-bottom: 0;
}

/* Modal Form Styling */
.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group textarea {
  width: 100%;
  padding: 1.2rem;
  background: rgba(13, 17, 23, 0.5); /* Semi-transparent dark */
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 140px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(13, 17, 23, 0.8);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.2),
    0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-group textarea::placeholder {
  color: rgba(139, 148, 158, 0.5);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 1rem;
}

.modal-actions button {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  min-width: 100px;
  justify-content: center;
}

.modal-actions .btn-secondary {
  background: transparent;
  border: 1px solid transparent;
}

.modal-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-color);
  border-color: var(--text-secondary);
}

/* Time Logs Styles */
.time-logs-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: #0d1117;
  margin-bottom: 1.5rem;
}

.simple-total-header {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.simple-time {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Time Log Entry Styles */
/* Time Log Entry Styles */
.log-entry {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-times {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.log-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.log-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 45px;
}

.log-value {
    color: var(--text-color);
}

.log-duration-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-family: 'SF Mono', 'Roboto Mono', monospace;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid rgba(88, 166, 255, 0.2);
  white-space: nowrap;
}

/* Timeline / Activity Log Styles */
.history-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.history-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.history-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 2rem;
  bottom: -10px;
  width: 2px;
  background: var(--glass-border);
}

.history-item:last-child::before {
  display: none;
}

.history-icon-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 4px var(--bg-color);
}

.action-created .history-icon-wrapper { border-color: var(--success-color); background: rgba(35, 134, 54, 0.2); }
.action-moved .history-icon-wrapper { border-color: var(--primary-color); background: rgba(88, 166, 255, 0.2); }
.action-deleted .history-icon-wrapper { border-color: var(--danger-color); background: rgba(218, 54, 51, 0.2); }
.action-timer .history-icon-wrapper { border-color: var(--warning-color); background: rgba(210, 153, 34, 0.2); }
.action-cleared .history-icon-wrapper { border-color: #ff7b72; }

.history-content {
  background: linear-gradient(145deg, rgba(22, 27, 34, 0.7), rgba(13, 17, 23, 0.8));
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text-color);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border-left: 3px solid transparent;
}

.history-item:hover .history-content {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  background: rgba(33, 38, 45, 0.8);
}

/* Colored Accents based on parent class */
.action-created .history-content { border-left-color: var(--success-color); }
.action-moved .history-content { border-left-color: var(--primary-color); }
.action-deleted .history-content { border-left-color: var(--danger-color); }
.action-timer .history-content { border-left-color: var(--warning-color); }
.action-cleared .history-content { border-left-color: #ff7b72; }

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.history-action-label {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.action-created .history-action-label { color: var(--success-color); background: rgba(35, 134, 54, 0.1); }
.action-moved .history-action-label { color: var(--primary-color); background: rgba(88, 166, 255, 0.1); }
.action-deleted .history-action-label { color: var(--danger-color); background: rgba(218, 54, 51, 0.1); }
.action-timer .history-action-label { color: var(--warning-color); background: rgba(210, 153, 34, 0.1); }

.history-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', monospace;
}

.history-text {
  color: var(--text-color);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0.6;
}

.empty-state svg {
  margin-bottom: 1rem;
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
    min-width: unset;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    text-align: center;
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px;
  }

  main {
    padding: 1rem;
    height: auto;
    overflow-x: hidden;
  }

  .kanban-board {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: auto;
  }

  .column {
    min-height: 300px;
    max-height: 600px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  .header-actions {
    width: 100%;
    padding: 4px;
    gap: 0.25rem;
  }

  .header-actions button {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    flex: 1 1 auto; /* Allow buttons to shrink/grow slightly to fill row */
    justify-content: center;
  }

  #add-task-btn, .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .header-actions .btn-primary {
      margin-left: 0;
  }

  main {
    padding: 0.5rem;
  }
  
  .task-card {
    padding: 1rem;
  }

  /* Fix Time Logs */
  .log-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .log-times {
    width: 100%;
  }

  .log-duration-badge {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
  }

  /* Fix Activity Log wrapping */
  .history-text {
    line-height: 1.8; /* Give space for badges */
    word-break: break-word;
  }

  .history-text .status-badge {
    margin: 4px 2px;
    display: inline-flex;
  }
}

/* Status Badges for History */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 2px;
  border: 1px solid transparent;
  vertical-align: middle;
}

.status-todo {
  background: rgba(110, 118, 129, 0.2);
  color: #8b949e;
  border-color: rgba(110, 118, 129, 0.2);
}

.status-progress {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border-color: rgba(88, 166, 255, 0.2);
}

.status-on-hold {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
  border-color: rgba(210, 153, 34, 0.2);
}

.status-done {
  background: rgba(35, 134, 54, 0.15);
  color: #3fb950;
  border-color: rgba(35, 134, 54, 0.2);
}
