/* ============================================
   Components: Kanban, Calendar, Modal, View Toggle
   ============================================ */

/* --- Kanban Board --- */

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 500px;
  align-items: flex-start;
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 3px solid var(--column-color, #4a90d9);
  border-radius: 8px 8px 0 0;
}

.kanban-column-header .column-title {
  font-size: 0.9rem;
}

.kanban-column-header .column-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

.kanban-column-header .column-count {
  background: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.kanban-cards {
  padding: 0.5rem;
  min-height: 100px;
  flex: 1;
  overflow-y: auto;
  transition: background 0.2s;
}

.kanban-cards.drag-over {
  background: rgba(74, 144, 217, 0.08);
}

.kanban-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: box-shadow 0.2s;
  border-left: 3px solid transparent;
}

.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card .card-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.kanban-card .card-meta {
  font-size: 0.8rem;
  color: #6c757d;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.kanban-card .card-value {
  font-weight: 600;
  color: #4a90d9;
  font-size: 0.9rem;
}

/* --- Calendar --- */

.calendar {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

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

.calendar-header .calendar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.calendar-header .calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-header .calendar-nav button {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.calendar-header .calendar-nav button:hover {
  background: #f8f9fa;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day-name {
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #6c757d;
  background: #f8f9fa;
}

.calendar-day {
  min-height: 100px;
  padding: 0.5rem;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.calendar-day:hover {
  background: #f8f9fa;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day.today {
  background: rgba(74, 144, 217, 0.06);
}

.calendar-day.today .day-number {
  background: #4a90d9;
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.other-month {
  opacity: 0.35;
}

.calendar-day .day-number {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.calendar-event-dot {
  display: block;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  line-height: 1.4;
}

.event-meeting {
  background: #4a90d9;
}

.event-call {
  background: #28a745;
}

.event-deadline {
  background: #dc3545;
}

.event-other {
  background: #6c757d;
}

.event-task {
  background: #ffc107;
  color: #333;
}

/* --- Modal --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* --- View Toggle --- */

.view-toggle {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dee2e6;
}

.view-toggle .btn {
  border-radius: 0;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: white;
  color: #333;
  border-right: 1px solid #dee2e6;
}

.view-toggle .btn:last-child {
  border-right: none;
}

.view-toggle .btn.active {
  background: #4a90d9;
  color: white;
}

.view-toggle .btn:hover:not(.active) {
  background: #f8f9fa;
}
