/* Canvas Card Renderer — Visual cards for render_ui tool output */

.canvas-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  margin: 8px 0;
  max-width: 100%;
  overflow: hidden;
}

/* Header block */
.cc-header {
  margin-bottom: 12px;
}
.cc-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}
.cc-header .cc-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Stats / Metric Cards grid */
.cc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.cc-stat {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.cc-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.cc-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.cc-stat-trend {
  font-size: 0.7rem;
  margin-top: 2px;
  font-weight: 500;
}
.cc-stat-trend.positive { color: #22c55e; }
.cc-stat-trend.negative { color: #ef4444; }
.cc-stat-trend.neutral { color: var(--color-text-muted); }

/* Table */
.cc-table-wrap {
  margin: 10px 0;
  overflow-x: auto;
}
.cc-table-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.cc-table th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.cc-table td {
  padding: 6px 10px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.cc-table tr:nth-child(even) td {
  background: var(--color-table-row);
}
.cc-table tr:last-child td {
  border-bottom: none;
}

/* List */
.cc-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.cc-list-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cc-list li {
  padding: 6px 10px;
  border-left: 3px solid var(--color-border);
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.4;
}
.cc-list li .cc-list-item-title {
  font-weight: 600;
}
.cc-list li .cc-list-item-subtitle {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

/* Text block */
.cc-text {
  margin: 10px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text);
}
.cc-text p {
  margin: 0 0 8px 0;
}

/* Chart placeholder */
.cc-chart {
  margin: 10px 0;
  padding: 12px;
  background: var(--color-background);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.cc-chart-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* Carousel */
.cc-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.cc-carousel::-webkit-scrollbar {
  height: 4px;
}
.cc-carousel::-webkit-scrollbar-track {
  background: transparent;
}
.cc-carousel::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
.cc-carousel-item {
  flex: 0 0 auto;
  width: 200px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: start;
}
.cc-carousel-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.cc-carousel-item .cc-carousel-body {
  padding: 8px 10px;
}
.cc-carousel-item .cc-carousel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}
.cc-carousel-item .cc-carousel-subtitle {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin: 2px 0 0;
}
.cc-carousel-item .cc-carousel-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin: 4px 0 0;
  line-height: 1.3;
}

/* Map placeholder */
.cc-map {
  margin: 10px 0;
}
.cc-map-point {
  font-size: 0.82rem;
  color: var(--color-text);
  padding: 3px 0;
}

/* Filter pills */
.cc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.cc-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: transparent;
}
.cc-pill.active {
  background: #b8733322;
  border-color: #b87333;
  color: #b87333;
}

/* Action buttons */
.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.cc-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: opacity 0.15s;
  color: var(--color-text);
  background: var(--color-background);
}
.cc-btn:hover {
  opacity: 0.8;
}
.cc-btn-primary {
  background: #b87333;
  border-color: #b87333;
  color: #fff;
}
.cc-btn-success {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.cc-btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.cc-btn-secondary {
  background: var(--color-panel);
  border-color: var(--color-border);
}

/* Progress bar */
.cc-progress-wrap {
  margin: 10px 0;
}
.cc-progress-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.cc-progress {
  height: 8px;
  background: var(--color-background);
  border-radius: 4px;
  overflow: hidden;
}
.cc-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #b87333;
  transition: width 0.3s ease;
}
.cc-progress-fill.success { background: #22c55e; }
.cc-progress-fill.danger { background: #ef4444; }

/* Block separator */
.cc-separator {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
  opacity: 0.5;
}
