/* Base styles for the Kanban app */
.lb-kanban-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  padding: 20px;
  max-width: 100%;
  margin: 0 auto;
}

.lb-kanban-loading,
.lb-kanban-error {
  text-align: center;
  padding: 40px;
  font-size: 18px;
}

.lb-kanban-error {
  color: #d32f2f;
}

/* Login Form */
.lb-kanban-login-wrapper {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lb-kanban-login-box {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
}

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

.login-header h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #333;
}

.login-header p {
  margin: 0;
  color: #6c757d;
  font-size: 14px;
}

.login-error {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.button-block {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.button-block:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Header */
.lb-kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  gap: 20px;
  flex-wrap: wrap;
}

.lb-kanban-header h2 {
  margin: 0;
  font-size: 28px;
  color: #333;
}

/* Search Bar */
.lb-kanban-search {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-input {
  flex: 1;
  padding: 10px 36px 10px 12px;
  border: 2px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-clear-button {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.search-clear-button:hover {
  background: #f0f0f0;
  color: #333;
}

.search-hint {
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
  white-space: nowrap;
}

/* Search Match Styling */
.lb-kanban-task.search-match {
  outline: 3px solid #4CAF50;
  outline-offset: -3px;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2), 0 4px 8px rgba(0,0,0,0.15);
}

.lb-kanban-task.search-dimmed {
  opacity: 0.4;
  filter: grayscale(30%);
}

.lb-kanban-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.filter-dropdown {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  min-width: 180px;
}

.filter-dropdown:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.lb-kanban-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 20px;
}

.user-role {
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
}

.user-role.agency {
  background: #2196F3;
  color: white;
}

.user-role.client {
  background: #4CAF50;
  color: white;
}

.lb-kanban-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-button {
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.logout-button:hover {
  background: #c82333;
  color: white;
  text-decoration: none;
}

/* Kanban Board */
.lb-kanban-board {
  width: 100%;
}

.lb-kanban-columns {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
}

/* Column */
.lb-kanban-column {
  flex: 0 0 280px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.lb-kanban-column.drag-over {
  background: #e3f2fd;
  border: 2px dashed #2196F3;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

.column-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
}

.task-count {
  background: #6c757d;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.column-tasks {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  min-height: 100px;
}

/* Task wrapper for drag-and-drop positioning */
.task-wrapper {
  position: relative;
  margin-bottom: 10px;
  transition: margin 0.2s ease;
}

.task-wrapper.drag-before {
  margin-top: 40px;
}

.task-wrapper.drag-after {
  margin-bottom: 40px;
}

.task-wrapper.drag-before::before,
.task-wrapper.drag-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 3px dashed #2196F3;
  background: transparent;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

.task-wrapper.drag-before::before {
  top: -6px;
}

.task-wrapper.drag-after::after {
  bottom: -6px;
}

@keyframes pulse {
  from {
    opacity: 0.5;
    transform: scaleY(1);
  }
  to {
    opacity: 1;
    transform: scaleY(1.5);
  }
}

.add-task-button {
  width: 100%;
  padding: 10px;
  background: white;
  border: 2px dashed #dee2e6;
  border-radius: 6px;
  color: #6c757d;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.add-task-button:hover {
  border-color: #2196F3;
  color: #2196F3;
  background: #f0f7ff;
}

/* Task Card */
.lb-kanban-task {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.lb-kanban-task:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.lb-kanban-task.private-task {
  border-left: 4px solid #ff9800;
}

.lb-kanban-task.priority-high {
  border-left: 4px solid #ff9800;
}

.lb-kanban-task.priority-urgent {
  border-left: 4px solid #f44336;
}

.lb-kanban-task.is-new {
  border: 2px solid #2196F3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.lb-kanban-task.is-new:hover {
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3), 0 4px 8px rgba(0,0,0,0.15);
}

.task-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.creator-badge-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.creator-badge-circle.agency-creator {
  background: #2196F3;
}

.creator-badge-circle.client-creator {
  background: #4CAF50;
}

.task-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  flex: 1;
}

.private-badge {
  font-size: 14px;
  opacity: 0.7;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.task-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-date {
  font-size: 11px;
  color: #6c757d;
}

.assignee-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: #9C27B0;
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.task-description {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 8px;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6c757d;
  margin-top: 8px;
}

.task-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* User Badges */
.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  color: white;
  cursor: help;
}

/* Creator badge - inline with title, smaller */
.creator-badge-inline {
  width: 20px;
  height: 20px;
  font-size: 9px;
  flex-shrink: 0;
}

.creator-badge-inline.agency-creator {
  background: #2196F3;
}

.creator-badge-inline.client-creator {
  background: #4CAF50;
}

/* Assignee badge - bottom right, larger with icon */
.assignee-badge-bottom {
  background: #9C27B0;
  width: auto;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  gap: 4px;
}

.priority-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: bold;
}

.priority-badge.priority-high {
  background: #fff3e0;
  color: #e65100;
}

.priority-badge.priority-urgent {
  background: #ffebee;
  color: #c62828;
}

.task-date {
  font-size: 11px;
}

.comment-indicator {
  font-size: 11px;
  color: #6c757d;
}

.comment-indicator.has-unread {
  color: #2196F3;
  font-weight: 600;
}

/* Modal */
.lb-kanban-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.lb-kanban-modal {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.close-button {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-button:hover {
  background: #f8f9fa;
  color: #212529;
}

.modal-form {
  padding: 20px;
}

.task-creator-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.task-creator-info .user-badge {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.creator-text {
  color: #495057;
  font-weight: 500;
}

.attachment-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.attachment-link {
  flex: 1;
  color: #2196F3;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-link:hover {
  text-decoration: underline;
}

.file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-upload input[type="file"] {
  font-size: 14px;
}

.upload-status {
  color: #6c757d;
  font-size: 14px;
  font-style: italic;
}

.no-attachment {
  color: #6c757d;
  font-size: 14px;
  font-style: italic;
  margin: 0;
}

.button-small {
  padding: 4px 10px;
  font-size: 12px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #495057;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
  resize: vertical;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.button {
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid #ced4da;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.button:hover {
  background: #f8f9fa;
}

.button-primary {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

.button-primary:hover {
  background: #1976D2;
  border-color: #1976D2;
}

.button-danger {
  background: #f44336;
  color: white;
  border-color: #f44336;
}

.button-danger:hover {
  background: #d32f2f;
  border-color: #d32f2f;
}

/* Comments */
.task-comments {
  padding: 20px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}

.task-comments h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.no-comments {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.comment {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.comment-date {
  color: #6c757d;
  font-size: 12px;
}

.comment-text {
  font-size: 14px;
  line-height: 1.5;
  color: #212529;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.comment-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.comment-action-button {
  background: none;
  border: none;
  color: #2196F3;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: background 0.2s;
}

.comment-action-button:hover {
  background: #f0f0f0;
}

.comment-delete-button {
  color: #dc3545;
}

.comment-delete-button:hover {
  background: #ffebee;
}

.comment-edit-mode {
  margin-top: 8px;
}

.comment-edit-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 8px;
}

.comment-edit-textarea:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.comment-edit-actions {
  display: flex;
  gap: 8px;
}

.add-comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-comment-form textarea {
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.add-comment-form textarea:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .lb-kanban-columns {
    flex-direction: column;
  }
  
  .lb-kanban-column {
    flex: 1;
    max-height: none;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .button {
    width: 100%;
  }
}

/* Archive Page Styles */
.archive-link {
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.archive-link:hover {
  background: #5a6268;
  color: white;
  text-decoration: none;
}

.lb-kanban-archive {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  padding: 20px;
  max-width: 100%;
  margin: 0 auto;
}

.archive-content {
  margin-top: 30px;
}

.archive-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.archive-empty p {
  font-size: 16px;
  margin: 10px 0;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

.archive-task-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}

.archive-task-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.archive-task-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
  cursor: pointer;
  flex: 1;
}

.archive-task-title:hover {
  color: #2196F3;
}

.archive-task-description {
  font-size: 14px;
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 15px;
}

.archive-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 13px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.archive-meta-item {
  color: #6c757d;
}

.archive-meta-item strong {
  color: #495057;
  font-weight: 600;
}

.archive-meta-item.priority-high {
  color: #e65100;
}

.archive-meta-item.priority-urgent {
  color: #c62828;
}

/* Responsive Archive Updates */
@media (max-width: 768px) {
  .archive-list {
    grid-template-columns: 1fr;
  }
}

/* Toggle Button */
.toggle-button {
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-button:hover {
  background: #5a6268;
}

/* Archive Mode Button */
.archive-mode-button {
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.archive-mode-button:hover {
  background: #5a6268;
}

.archive-mode-button.active {
  background: #28a745;
}

/* Task Checkboxes */
.task-checkbox-wrapper {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.task-checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.task-wrapper {
  position: relative;
}

.task-wrapper.task-selected .lb-kanban-task {
  border: 2px solid #2196F3;
  background: rgba(33, 150, 243, 0.05);
}

/* Bottom Action Bar */
.bulk-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 20px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  gap: 15px;
  z-index: 1000;
}
