/**
 * Events Tab Styles - Pipeline/Kanban view for event hosting requests
 * Parallels rentals.css structure
 */

/* =============================================
   EVENT PIPELINE VIEW
   ============================================= */

.event-pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  min-height: 400px;
  overflow-x: auto;
  padding-bottom: 1rem;
}

@media (max-width: 1200px) {
  .event-pipeline {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
}

@media (max-width: 900px) {
  .event-pipeline {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 600px) {
  .event-pipeline {
    grid-template-columns: 1fr;
  }
}

/* Reuse pipeline-column styles from rentals.css */
/* Event-specific column colors */
.event-pipeline .pipeline-column[data-stage="requests"] .pipeline-header h3 { color: #6366f1; }
.event-pipeline .pipeline-column[data-stage="requests"] .pipeline-header { border-bottom-color: #6366f1; }
.event-pipeline .pipeline-column[data-stage="requests"] .pipeline-count { background: #eef2ff; color: #4f46e5; }

.event-pipeline .pipeline-column[data-stage="approved"] .pipeline-header h3 { color: #8b5cf6; }
.event-pipeline .pipeline-column[data-stage="approved"] .pipeline-header { border-bottom-color: #8b5cf6; }
.event-pipeline .pipeline-column[data-stage="approved"] .pipeline-count { background: #f5f3ff; color: #7c3aed; }

.event-pipeline .pipeline-column[data-stage="contract"] .pipeline-header h3 { color: #f59e0b; }
.event-pipeline .pipeline-column[data-stage="contract"] .pipeline-header { border-bottom-color: #f59e0b; }
.event-pipeline .pipeline-column[data-stage="contract"] .pipeline-count { background: #fffbeb; color: #d97706; }

.event-pipeline .pipeline-column[data-stage="deposit"] .pipeline-header h3 { color: #10b981; }
.event-pipeline .pipeline-column[data-stage="deposit"] .pipeline-header { border-bottom-color: #10b981; }
.event-pipeline .pipeline-column[data-stage="deposit"] .pipeline-count { background: #ecfdf5; color: #059669; }

.event-pipeline .pipeline-column[data-stage="ready"] .pipeline-header h3 { color: #22c55e; }
.event-pipeline .pipeline-column[data-stage="ready"] .pipeline-header { border-bottom-color: #22c55e; }
.event-pipeline .pipeline-column[data-stage="ready"] .pipeline-count { background: #f0fdf4; color: #16a34a; }

/* =============================================
   EVENT CARD SPECIFIC STYLES
   ============================================= */

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

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

.event-card .event-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.2;
}

.event-card .event-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.125rem;
}

.event-card .client-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.event-card .guest-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.event-card .card-footer {
  margin-top: 0.5rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-card .fee-display {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

/* =============================================
   EVENT STATUS BADGES
   ============================================= */

/* Request status badges - reuse from rentals */
.status-badge.requests { background: #dbeafe; color: #1e40af; }

/* Deposit status specific to events */
.status-badge.refunded { background: #e0f2fe; color: #0369a1; }

/* =============================================
   EVENT DETAIL MODAL SPECIFICS
   ============================================= */

.event-detail-section {
  margin-bottom: 1.5rem;
}

.event-detail-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Staffing contacts grid */
.staffing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .staffing-grid {
    grid-template-columns: 1fr;
  }
}

.staffing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.staffing-card .staffing-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.staffing-card .staffing-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.staffing-card .staffing-phone {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Acknowledgments checklist */
.acknowledgments-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .acknowledgments-list {
    grid-template-columns: 1fr;
  }
}

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

.ack-item.checked {
  color: var(--text);
}

.ack-item .ack-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.ack-item.checked .ack-check {
  background: #d1fae5;
  color: #065f46;
}

.ack-item:not(.checked) .ack-check {
  background: #fee2e2;
  color: #991b1b;
}

/* Spaces selection */
.spaces-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (max-width: 600px) {
  .spaces-checklist {
    grid-template-columns: 1fr;
  }
}

.space-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.space-checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

/* =============================================
   EVENT FEES DISPLAY
   ============================================= */

.fees-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .fees-grid {
    grid-template-columns: 1fr;
  }
}

.fee-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.fee-card h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.fee-card .fee-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}

.fee-card .fee-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.fee-card .fee-status.paid {
  color: #16a34a;
  font-weight: 500;
}

.fee-card .fee-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Total due card */
.fee-card.total {
  background: var(--accent);
  border-color: var(--accent);
}

.fee-card.total h4,
.fee-card.total .fee-amount,
.fee-card.total .fee-note {
  color: white;
}

/* =============================================
   CREATE EVENT REQUEST FORM
   ============================================= */

.event-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .event-form-grid {
    grid-template-columns: 1fr;
  }
}

.event-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.time-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.time-inputs input[type="time"] {
  flex: 1;
}

.time-inputs span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =============================================
   EVENT COMPLETION
   ============================================= */

.completion-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.completion-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.completion-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.completion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.completion-item.done {
  background: #f0fdf4;
}

.completion-item .check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.completion-item.done .check-icon {
  background: #22c55e;
  color: white;
}

.completion-item:not(.done) .check-icon {
  background: var(--border);
  color: var(--text-muted);
}

.completion-item .item-text {
  flex: 1;
  font-size: 0.9rem;
}

.completion-item .item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =============================================
   REFUND SECTION
   ============================================= */

.refund-section {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}

.refund-section.has-deductions {
  background: #fffbeb;
  border-color: #fde68a;
}

.refund-calculation {
  font-size: 0.9rem;
}

.refund-calculation .line-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.refund-calculation .line-item.deduction {
  color: #dc2626;
}

.refund-calculation .line-item.total {
  font-weight: 600;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.deduction-input {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.deduction-input input[type="number"] {
  width: 100px;
}

.deduction-input input[type="text"] {
  flex: 1;
}

/* =============================================
   EVENTS CALENDAR
   ============================================= */

.events-calendar {
  overflow-x: auto;
}

.events-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 700px;
}

.events-calendar-header {
  display: contents;
}

.events-calendar-header .day-header {
  background: var(--bg);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.events-calendar-header .day-header.weekend {
  color: var(--text-muted);
  opacity: 0.7;
}

.events-calendar-body {
  display: contents;
}

.events-calendar-cell {
  background: var(--bg-card);
  min-height: 100px;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.events-calendar-cell.other-month {
  background: var(--bg);
  opacity: 0.5;
}

.events-calendar-cell.weekend {
  background: var(--bg);
}

.events-calendar-cell.today {
  background: var(--accent-light, #eef2ff);
}

.events-calendar-cell .cell-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.events-calendar-cell.today .cell-date {
  color: var(--accent);
}

.events-calendar-cell .cell-events {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

/* Event chips in calendar */
.event-chip {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.event-chip:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.event-chip.submitted {
  background: #6366f1;
}

.event-chip.under_review {
  background: #8b5cf6;
}

.event-chip.approved {
  background: #10b981;
}

.event-chip.contract_sent {
  background: #f59e0b;
}

.event-chip.deposit_paid {
  background: #22c55e;
}

.event-chip.ready {
  background: #16a34a;
}

.event-chip.completed {
  background: #6b7280;
}

.event-chip.denied {
  background: #ef4444;
}

.event-chip.delayed {
  background: #f97316;
}

.event-chip .chip-time {
  font-size: 0.6rem;
  opacity: 0.9;
}

.event-chip .chip-name {
  font-weight: 600;
}

/* Event tooltip */
.event-calendar-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-width: 280px;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.event-calendar-tooltip.visible {
  opacity: 1;
}

.event-calendar-tooltip .tooltip-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}

.event-calendar-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.event-calendar-tooltip .tooltip-label {
  color: var(--text-muted);
}

.event-calendar-tooltip .tooltip-value {
  font-weight: 500;
}

/* Calendar empty state */
.events-calendar-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .events-calendar-grid {
    min-width: 500px;
  }

  .events-calendar-cell {
    min-height: 80px;
    padding: 0.25rem;
  }

  .event-chip {
    font-size: 0.6rem;
    padding: 0.125rem 0.25rem;
  }
}
