*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #111;
}

[data-demo] {
  padding: 48px 0;
}

.demo-divider {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
}
.demo-divider h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
}
.demo-divider p {
  font-size: 16px;
  color: #666;
  margin: 0;
}

.demo-container {
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 80vh;
  margin: 0 auto;
  max-width: 900px;
  gap: 0;
}

/* ---- Timeline panel (left) ---- */
.demo-timeline-panel {
  flex: 1;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px 0 0 8px;
}
.demo-timeline-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.demo-timeline-scroll .timeline {
  max-width: 100%;
  padding: 0 4px;
}

/* Full-width images in demo timeline */
.demo-timeline-scroll .image-thumbs {
  flex-direction: column;
}
.demo-timeline-scroll .image-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Full-image takeover view */
.demo-fullimage-view {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  overflow: hidden;
}
.demo-fullimage-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.demo-fullimage-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* ---- Highlight animation ---- */
@keyframes demo-highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.6); }
  40%  { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}
.demo-highlight {
  animation: demo-highlight-pulse 0.8s ease-in-out 3;
  background-color: rgba(255, 193, 7, 0.12);
  border-radius: 6px;
  transition: background-color 0.5s ease;
}

/* ---- Chat input bar at bottom of phone ---- */
.demo-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #ddd;
  background: #fff;
  flex-shrink: 0;
}
.demo-chat-input input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
}
.demo-chat-input input:focus {
  border-color: #007bff;
}
.demo-chat-input button {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.demo-chat-input button:hover {
  background: #0056b3;
}

/* ---- Accordion panel (right) ---- */
.demo-accordion-panel {
  width: 380px;
  min-width: 300px;
  background: #fff;
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-left: none;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}
.demo-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  padding: 20px 20px 0;
  margin-bottom: 16px;
  text-align: center;
  flex-shrink: 0;
}
.demo-steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

/* Accordion step */
.demo-step {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.demo-step.active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.demo-step-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  background: #fafafa;
  transition: background 0.15s;
}
.demo-step-header:hover {
  background: #f0f0f0;
}
.demo-step.active .demo-step-header {
  background: #2c3e50;
  color: #fff;
}
.demo-step.completed .demo-step-header {
  background: #e8f5e9;
}
.demo-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
  border: 2px solid #999;
  color: #666;
}
.demo-step.active .demo-step-number {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.15);
}
.demo-step.completed .demo-step-number {
  border-color: #4caf50;
  background: #4caf50;
  color: #fff;
}
.demo-step-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}
.demo-step-chevron {
  font-size: 20px;
  transition: transform 0.2s;
}
.demo-step.active .demo-step-chevron {
  transform: rotate(180deg);
}

.demo-step-body {
  display: none;
  padding: 16px;
  border-top: 1px solid #e0e0e0;
}
.demo-step.active .demo-step-body {
  display: block;
}
.demo-step-description {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 12px;
}
.demo-step-description .demo-step-icon {
  vertical-align: middle;
  margin-right: 6px;
  font-size: 20px;
}

/* ---- Tasks view ---- */
.demo-tasks-view { padding: 12px; overflow-y: auto; flex: 1; }
.demo-tasks-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.demo-tasks-table th {
  text-align: left; padding: 8px 10px; font-weight: 600;
  color: #666; border-bottom: 2px solid #e0e0e0; font-size: 11px; text-transform: uppercase;
}
.demo-tasks-table td { padding: 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.demo-task-color-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle;
}
.demo-task-priority {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.demo-task-priority.High, .demo-task-priority.Critical { background: #ffebee; color: #c62828; }
.demo-task-priority.Medium { background: #fff8e1; color: #f57f17; }
.demo-task-priority.Low { background: #e8f5e9; color: #2e7d32; }

/* ---- Calendar view ---- */
.demo-calendar-view { padding: 12px; overflow-y: auto; flex: 1; }
.demo-calendar-month { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #2c3e50; }
.demo-calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e0e0e0; border-radius: 6px; overflow: hidden;
}
.demo-calendar-dayhead {
  background: #f5f5f5; padding: 6px 4px; text-align: center; font-size: 11px; font-weight: 600; color: #888;
}
.demo-calendar-cell {
  background: #fff; min-height: 48px; padding: 4px; font-size: 11px; position: relative;
}
.demo-calendar-cell.other-month { color: #ccc; background: #fafafa; }
.demo-calendar-cell.today { background: #e3f2fd; }
.demo-calendar-daynum { font-weight: 600; margin-bottom: 2px; }
.demo-calendar-event {
  font-size: 10px; padding: 1px 4px; border-radius: 3px; color: #fff; margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Event list view ---- */
.demo-event-list { margin-top: 16px; }
.demo-event-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid #f0f0f0; border-radius: 6px; margin-bottom: 6px; background: #fff;
}
.demo-event-color-bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.demo-event-title { font-weight: 600; font-size: 13px; }
.demo-event-dates { font-size: 11px; color: #888; }

/* ---- Kanban view ---- */
.demo-kanban-view { padding: 12px; overflow-x: auto; overflow-y: auto; flex: 1; display: flex; gap: 12px; }
.demo-kanban-column {
  min-width: 180px; flex: 1; background: #f5f5f5; border-radius: 8px; padding: 10px; display: flex; flex-direction: column;
}
.demo-kanban-column-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; color: #666; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.demo-kanban-count {
  background: #e0e0e0; color: #555; font-size: 10px; padding: 1px 6px; border-radius: 10px;
}
.demo-kanban-card {
  background: #fff; border-radius: 6px; padding: 10px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 3px solid;
}
.demo-kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.demo-kanban-card-meta { font-size: 11px; color: #888; display: flex; gap: 8px; align-items: center; }

/* Responsive */
@media (max-width: 860px) {
  .demo-container { flex-direction: column; align-items: stretch; height: auto; margin: 12px; }
  .demo-accordion-panel { width: 100%; min-width: unset; max-height: 40vh; border-left: 1px solid #e0e0e0; border-radius: 0 0 8px 8px; }
  .demo-timeline-panel { min-height: 50vh; border-radius: 8px 8px 0 0; }
}
