@import "tailwindcss";

@theme {
  --color-surface: #f8fafc;
  --color-panel: #ffffff;
}

body { height: 100vh; overflow: hidden; }
.tag-body { display: none; }
.tag-body.open { display: block; }
.tag-toggle .arrow { transition: transform 0.15s; display: inline-block; }
.tag-toggle.open .arrow { transform: rotate(90deg); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.tl-node { position: relative; cursor: pointer; padding: 8px 12px; margin-bottom: 2px; border-radius: 8px; transition: all 0.15s; }
.tl-node:hover { background: #f1f5f9; }
.tl-node.active { background: #eff6ff; }
.tl-dot { position: absolute; left: -17px; top: 14px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; z-index: 1; }
.tl-node.active .tl-dot { box-shadow: 0 0 0 3px rgba(59,130,246,0.3); }
.tl-dot-compacted { box-shadow: 0 0 0 3px rgba(245,158,11,0.4); }
.tl-node.active .tl-dot-compacted { box-shadow: 0 0 0 3px rgba(245,158,11,0.5), 0 0 0 6px rgba(59,130,246,0.2); }

/* Gantt chart */
.gantt { position: relative; margin-bottom: 4px; }
.gantt-hours { display: flex; border-bottom: 1px solid #f1f5f9; margin-bottom: 2px; }
.gantt-hour { flex: 1; text-align: center; font-size: 9px; color: #cbd5e1; font-family: monospace; padding: 1px 0; }
.gantt-lane { position: relative; height: 28px; margin-bottom: 2px; }
.gantt-bar { position: absolute; height: 24px; top: 2px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; padding: 0 6px; font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; transition: all 0.15s; min-width: 6px; opacity: 0.85; }
.gantt-bar:hover { opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 10; transform: scaleY(1.1); }
.gantt-bar.active { opacity: 1; box-shadow: 0 0 0 2px rgba(59,130,246,0.5); z-index: 10; }
.gantt-bar-claude_code { background: #E8926C; color: #fff; }
.gantt-bar-codex_cli { background: #10A37F; color: #fff; }
.gantt-bar-gemini_cli { background: #4285F4; color: #fff; }
.gantt-bar-cursor { background: #7B61FF; color: #fff; }
.gantt-now { position: absolute; top: 0; bottom: 0; width: 1px; background: #ef4444; z-index: 5; }
.gantt-area { position: relative; cursor: crosshair; }
.gantt-cursor { position: absolute; top: 0; bottom: 0; width: 1.5px; background: #ef4444; z-index: 15; pointer-events: none; opacity: 0; transition: opacity 0.1s; }
.gantt-area:hover .gantt-cursor { opacity: 1; }
.gantt-cursor-label { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 9px; font-family: monospace; color: #ef4444; font-weight: 700; white-space: nowrap; background: white; padding: 0 3px; border-radius: 2px; }
.split-view { display: flex; flex-direction: row; height: 100%; overflow-x: auto; overflow-y: hidden; }
.split-pane { flex: 0 0 calc(100% / 3); overflow-y: auto; border-right: 1px solid #e5e7eb; min-width: 0; position: relative; }
.split-view.panes-1 .split-pane { flex: 0 0 100%; }
.split-view.panes-2 .split-pane { flex: 0 0 50%; }
.split-pane:last-child { border-right: none; }
.split-header { position: sticky; top: 0; z-index: 5; background: white; padding: 8px 12px; border-bottom: 1px solid #e5e7eb; }
.split-msgs { padding: 8px; }
.time-highlight { animation: time-pulse 1s ease-out; }
@keyframes time-pulse { 0% { background: #fef08a; } 100% { background: transparent; } }
.parallel-badge { display: inline-block; font-size: 9px; font-weight: 700; background: #fbbf24; color: #78350f; padding: 1px 5px; border-radius: 3px; margin-left: 6px; }

/* Custom select wrapper */
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 28px; }
.select-wrap::after { content: ''; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #009689; pointer-events: none; }

/* Loading spinner */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #e2e8f0; border-top-color: #009689; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Heatmap */
.heatmap-wrap { overflow-x: auto; overflow-y: hidden; }
.heatmap-wrap::-webkit-scrollbar { height: 3px; }
.heatmap-wrap::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.hm-cell { width: 10px; height: 10px; border-radius: 2px; cursor: pointer; transition: all 0.1s; }
.hm-cell:hover { outline: 1.5px solid #475569; outline-offset: -0.5px; }
.heatmap-body { max-height: 0; overflow: hidden; transition: max-height 0.2s ease-out; }
.heatmap-body.open { max-height: 140px; }

/* Compaction breakpoint */
.compaction-break { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.compaction-break::before, .compaction-break::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, #f59e0b 0, #f59e0b 4px, transparent 4px, transparent 8px); }
.compaction-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; font-size: 10px; font-weight: 600; white-space: nowrap; }
@keyframes compact-pulse { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); } 100% { box-shadow: 0 0 0 8px rgba(245,158,11,0); } }

/* Interruption breakpoint */
.interruption-break { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.interruption-break::before, .interruption-break::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, #ef4444 0, #ef4444 4px, transparent 4px, transparent 8px); }
.interruption-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; font-size: 10px; font-weight: 600; white-space: nowrap; }
@keyframes interrupt-pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.tl-dot-interrupted { box-shadow: 0 0 0 3px rgba(239,68,68,0.4); }
.tl-node.active .tl-dot-interrupted { box-shadow: 0 0 0 3px rgba(239,68,68,0.5), 0 0 0 6px rgba(59,130,246,0.2); }

/* Calendar */
.cal-pop { position: absolute; top: 100%; left: 0; margin-top: 4px; background: white; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); z-index: 50; padding: 10px; width: 260px; user-select: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-hdr { font-size: 9px; font-weight: 600; color: #9ca3af; text-align: center; padding: 2px 0 4px; }
.cal-day { position: relative; font-size: 11px; text-align: center; padding: 4px 0; border-radius: 6px; cursor: pointer; color: #6b7280; transition: all 0.1s; }
.cal-day:hover { background: #f0fdfa; }
.cal-day.has-data { color: #111828; font-weight: 600; }
.cal-day.has-data::after { content: ''; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #009689; }
.cal-day.selected { background: #009689; color: white; font-weight: 700; }
.cal-day.selected::after { background: white; }
.cal-day.today { outline: 1.5px solid #009689; outline-offset: -1.5px; }
.cal-day.outside { color: #d1d5db; }
.cal-day.outside.has-data { color: #9ca3af; }
.cal-day.outside.has-data::after { background: #b2dfdb; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-nav button { width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent; cursor: pointer; font-size: 12px; color: #6b7280; display: flex; align-items: center; justify-content: center; }
.cal-nav button:hover { background: #f0fdfa; color: #009689; }
.cal-month { font-size: 12px; font-weight: 600; color: #111828; }

/* Minimap */
.minimap { width: 60px; flex-shrink: 0; position: relative; background: #f8fafc; border-left: 1px solid #e5e7eb; cursor: pointer; overflow: hidden; }
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap-viewport { position: absolute; left: 0; right: 0; background: rgba(0,150,137,0.08); border: 1.5px solid rgba(0,150,137,0.3); border-radius: 2px; pointer-events: none; min-height: 8px; transition: top 0.05s ease-out, height 0.05s ease-out; }
.minimap:hover .minimap-viewport { border-color: rgba(0,150,137,0.5); background: rgba(0,150,137,0.12); }
.minimap-hover-line { position: absolute; left: 0; right: 0; height: 1px; background: rgba(0,150,137,0.4); pointer-events: none; }
