/* variables */
:root {
  --bg-app: #0d0e15;
  --bg-sidebar: #141622;
  --bg-card: #1d1f30;
  --border-color: rgba(255, 255, 255, 0.06);
  --text-main: #f8f9fa;
  --text-muted: #7982a9;
  
  --primary: #f0a500;
  --primary-hover: #e09900;
  
  --priority-low-bg: rgba(78, 205, 196, 0.12);
  --priority-low-text: #4ecdc4;
  --priority-medium-bg: rgba(240, 165, 0, 0.12);
  --priority-medium-text: #f0a500;
  --priority-high-bg: rgba(255, 107, 107, 0.12);
  --priority-high-text: #ff6b6b;
  
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* layout container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

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

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

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.02);
}

.back-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: rgba(240, 165, 0, 0.05);
}

.brand-logo {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
  padding-right: 1.25rem;
}

.brand-logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-title .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}


/* buttons */
.primary-button {
  background-color: var(--primary);
  color: #000;
  font-weight: 600;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.primary-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.secondary-button {
  background-color: rgba(255, 67, 67, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 67, 67, 0.3);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}

.secondary-button:hover {
  background-color: rgba(255, 67, 67, 0.3);
}

.ghost-button {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ghost-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* kanban board container */
.board-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  flex: 1;
  min-height: 0; /* allows grid items to shrink */
}

/* kanban column */
.board-column {
  background-color: var(--bg-sidebar);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.column-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

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

/* task cards list */
.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 100px;
  transition: background-color 0.2s ease;
}

.column-cards.drag-over {
  background-color: rgba(240, 165, 0, 0.04);
  border-radius: 0 0 12px 12px;
}

/* task card */
.task-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 165, 0, 0.4);
}

.task-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

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

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

.card-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

/* badges */
.priority-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.priority-low {
  background-color: var(--priority-low-bg);
  color: var(--priority-low-text);
}

.priority-medium {
  background-color: var(--priority-medium-bg);
  color: var(--priority-medium-text);
}

.priority-high {
  background-color: var(--priority-high-bg);
  color: var(--priority-high-text);
}

.assignee-badge {
  font-size: 0.75rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted);
}

/* modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.modal-backdrop.is-hidden .modal-card {
  transform: translateY(20px);
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.close-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.close-button:hover {
  color: var(--text-main);
}

.task-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-form label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.task-form input[type="text"],
.task-form textarea,
.task-form select {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  width: 100%;
}

.task-form input[type="text"]:focus,
.task-form textarea:focus,
.task-form select:focus {
  border-color: var(--primary);
  outline: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

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

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

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* responsive media queries */
@media (max-width: 850px) {
  .app-container {
    height: 100vh;
    padding: 1rem 1rem 0.5rem 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .header-brand {
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
  }

  .brand-logo {
    padding-right: 0.75rem;
  }

  .brand-logo img {
    height: 24px;
  }

  .brand-title h1 {
    font-size: 1.15rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .primary-button {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
  }

  .board-container {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    align-items: stretch;
    height: calc(100vh - 170px);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .board-column {
    min-width: 290px;
    flex: 0 0 290px;
    scroll-snap-align: start;
    max-height: 100%;
  }
}

