/* Components CSS - Wiederverwendbare Komponenten */

/* Kanban Board - COMPACT VERSION */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.kanban-column {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.kanban-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.kanban-column > .kanban-header .kanban-title {
  font-family: var(--font-display, "Montserrat", system-ui, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage, var(--accent));
}

.kanban-count {
  background: var(--surface2);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-height: 40px;
  align-items: stretch;
  justify-content: flex-start;
  transition: all 0.2s ease;
}

/* Poll Cards - COMPACT VERSION */
.poll-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
  font-size: 11px;
}

.poll-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.poll-card:active {
  cursor: grabbing;
}

.poll-card.dragging {
  opacity: 0.6;
  transform: rotate(2deg) scale(0.98);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.poll-card.umlauf {
  border-left: 3px solid var(--warn);
}

.poll-card.meinung {
  border-left: 3px solid var(--no);
}

.poll-card.assembly {
  border-left: 3px solid var(--accent);
}

.poll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.poll-type {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.poll-type.umlauf {
  background: rgba(201, 177, 90, 0.2);
  border-color: var(--warn);
  color: var(--warn);
}

.poll-type.meinung {
  background: rgba(208, 96, 96, 0.2);
  border-color: var(--no);
  color: var(--no);
}

.poll-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  color: var(--text);
  line-height: 1.2;
}

.poll-object {
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 var(--space-xs) 0;
}

.poll-object-id {
  font-size: 9px;
  color: var(--muted);
  margin: 0 0 var(--space-xs) 0;
  opacity: 0.8;
}

.poll-deadline {
  font-size: 9px;
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  display: inline-block;
}

.deadline-normal {
  background: rgba(47, 186, 122, 0.1);
  color: var(--accent);
  border: 1px solid rgba(47, 186, 122, 0.3);
}

.deadline-warning {
  background: rgba(201, 177, 90, 0.1);
  color: var(--warn);
  border: 1px solid rgba(201, 177, 90, 0.3);
}

.deadline-urgent {
  background: rgba(201, 177, 90, 0.2);
  color: var(--warn);
  border: 1px solid rgba(201, 177, 90, 0.5);
}

.deadline-overdue {
  background: rgba(208, 96, 96, 0.1);
  color: var(--no);
  border: 1px solid rgba(208, 96, 96, 0.3);
}

.poll-progress {
  margin-top: var(--space-xs);
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.progress-text {
  font-size: 9px;
  color: var(--muted);
  text-align: right;
}

/* Drag and Drop */
.kanban-column.drag-over {
  background: rgba(47, 186, 122, 0.05);
  border-color: var(--accent);
  transform: scale(1.005);
  box-shadow: 0 0 0 1px rgba(47, 186, 122, 0.2);
}

.kanban-cards.drag-over {
  background: rgba(47, 186, 122, 0.08);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-xs);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.kanban-cards.drag-over::after {
  content: '↓ Hier ablegen ↓';
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}

/* Detail Modal */
.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-lg);
}

.detail-modal.show {
  display: flex;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.detail-content {
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: contentSlideIn 0.3s ease;
}

@keyframes contentSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--line);
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  line-height: 1.2;
}

.detail-close {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  font-weight: 600;
}

.detail-close:hover {
  background: var(--line);
  color: var(--text);
  transform: scale(1.1);
}

/* Form Components */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Search Components - FIXED */
.search-results-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-results-overlay.show {
  display: block;
}

.search-results-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--line);
}

.search-result-item:hover {
  background: var(--surface2);
}

.search-result-item.selected {
  background: var(--accent);
  color: #FFFFFF;
}

.search-result-icon {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  min-width: 24px;
  text-align: center;
}

.search-result-icon.umlauf {
  background: rgba(201, 177, 90, 0.2);
  border-color: var(--warn);
  color: var(--warn);
}

.search-result-icon.meinung {
  background: rgba(208, 96, 96, 0.2);
  border-color: var(--no);
  color: var(--no);
}

.search-result-content {
  flex: 1;
}

.search-result-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.search-result-subtitle {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
  line-height: 1.2;
}

/* Apple-style Clear Button */
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.search-clear:hover {
  background: var(--line);
  color: var(--text);
  transform: translateY(-50%) scale(1.1);
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 300px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.success {
  border-color: var(--yes);
  background: rgba(47, 181, 116, 0.1);
}

.notification.error {
  border-color: var(--no);
  background: rgba(208, 96, 96, 0.1);
}

/* Detail Modal Content Styles */
.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.detail-info-section {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.detail-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 var(--space-md) 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.detail-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.detail-info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--line);
}

.detail-info-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-info-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.detail-info-label svg {
  width: 14px;
  height: 14px;
}

.detail-info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.detail-progress-section {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.progress-visual {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.progress-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg calc(var(--progress) * 3.6deg), var(--surface) calc(var(--progress) * 3.6deg) 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-circle::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--surface);
}

.progress-circle .progress-text {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.progress-details {
  flex: 1;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-md);
}

.progress-stat {
  text-align: center;
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.progress-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.progress-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--line);
  transform: translateY(-1px);
}

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

@media (max-width: 768px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
  
  .detail-content {
    margin: var(--space-md);
    max-width: calc(100vw - 2 * var(--space-md));
  }
}
