/**
 * TASKMATE - Proposals Styles
 * ============================
 * Styles fuer den Vorschlaege-Bereich
 */

/* Proposals View */
.proposals-view {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  overflow: auto;
}

.proposals-view.active {
  display: flex;
}

/* Proposals Header */
.proposals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.proposals-header h2 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0;
}

.proposals-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.proposals-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.proposals-sort label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.proposals-sort select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  transition: all var(--transition-fast);
}

.proposals-sort select:hover {
  border-color: var(--border-dark);
}

.proposals-sort select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* Proposals List */
.proposals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Proposal Card */
.proposal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.proposal-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.proposal-card.approved {
  border-color: var(--success);
  border-width: 2px;
}

.proposal-card.approved::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--success);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.proposal-card.archived {
  opacity: 0.7;
  background: var(--bg-tertiary);
}

.proposal-card {
  position: relative;
}

/* Proposal Badges Container */
.proposal-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Proposal Header */
.proposal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.proposal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.proposal-approved-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--success);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
}

.proposal-approved-badge svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Archived Badge */
.proposal-archived-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
}

.proposal-archived-badge svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

/* Linked Task */
.proposal-linked-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.proposal-linked-task svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
  fill: none;
  flex-shrink: 0;
}

.proposal-linked-task span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Proposal Description */
.proposal-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Proposal Meta */
.proposal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.proposal-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.proposal-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.7rem;
}

.proposal-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Proposal Actions */
.proposal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Vote Button */
.proposal-vote-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.proposal-vote-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-dark);
}

.proposal-vote-btn.voted {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}

.proposal-vote-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.proposal-vote-count {
  font-weight: 600;
}

.proposal-vote-btn.own-proposal {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Approve Checkbox */
.proposal-approve {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proposal-approve:hover {
  background: var(--bg-hover);
}

.proposal-approve input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--success);
  cursor: pointer;
}

.proposal-approve span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.proposal-approve.approved {
  background: var(--success-bg);
  border-color: var(--success);
}

.proposal-approve.approved span {
  color: var(--success-text);
  font-weight: 500;
}

/* Delete Button */
.proposal-delete-btn {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proposal-delete-btn:hover {
  background: var(--error);
  border-color: var(--error);
  color: var(--text-inverse);
}

.proposal-delete-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

/* Archive Button */
.proposal-archive-btn {
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proposal-archive-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}

.proposal-archive-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

/* Approved By Info */
.proposal-approved-by {
  font-size: 0.8rem;
  color: var(--success-text);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* Proposal Modal */
.proposal-modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.proposal-modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.proposal-modal-form label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

.proposal-modal-form input,
.proposal-modal-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
}

.proposal-modal-form input:hover,
.proposal-modal-form textarea:hover {
  border-color: var(--border-dark);
}

.proposal-modal-form textarea {
  min-height: 120px;
  resize: vertical;
}

.proposal-modal-form input:focus,
.proposal-modal-form textarea:focus,
.proposal-modal-form select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.proposal-modal-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proposal-modal-form select:hover {
  border-color: var(--border-dark);
}

.proposal-modal-form select optgroup {
  font-weight: 600;
  color: var(--text-primary);
}

.proposal-modal-form select option {
  padding: 8px;
}

/* Empty State */
.proposals-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.proposals-empty svg {
  width: 64px;
  height: 64px;
  fill: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.proposals-empty h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.proposals-empty p {
  font-size: 0.9rem;
  margin: 0;
}

/* Highlight Animation - for navigation from inbox */
.proposal-card.highlight-pulse {
  animation: highlightPulse 2.5s ease-out;
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.7);
    border-color: #EF4444;
  }
  30% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.5);
    border-color: #EF4444;
  }
  100% {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-default);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .proposals-view {
    padding: 1rem;
  }

  .proposals-header {
    flex-direction: column;
    align-items: stretch;
  }

  .proposals-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .proposal-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .proposal-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
