/* FlowState — Work Session Saver */
/* Design System */

:root {
  /* Colors */
  --bg-primary: #0f0f12;
  --bg-secondary: #16161b;
  --bg-tertiary: #1c1c24;
  --bg-hover: #22222c;
  
  --text-primary: #f5f5f7;
  --text-secondary: #a0a0a8;
  --text-muted: #6e6e78;
  
  --accent: #7c5cff;
  --accent-hover: #9175ff;
  --accent-soft: rgba(124, 92, 255, 0.15);
  
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(124, 92, 255, 0.5);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
}

/* Layout */
.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-icon {
  font-size: 18px;
}

.capture-btn-container {
  margin-bottom: var(--space-xl);
}

.capture-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--accent), #9175ff);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.capture-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.4);
}

.capture-btn:active {
  transform: translateY(0);
}

.capture-icon {
  font-size: 18px;
}

.shortcut {
  position: absolute;
  right: var(--space-md);
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

.stats {
  margin-top: auto;
  display: flex;
  gap: var(--space-md);
}

.stat {
  flex: 1;
  background: var(--bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-tertiary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 300px;
}

.search-box:focus-within {
  border-color: var(--border-focus);
}

.search-icon {
  font-size: 16px;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
}

.timeline {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg);
}

.timeline-title:first-child {
  margin-top: 0;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Session Card */
.session-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.session-card:hover {
  background: var(--bg-hover);
  border-color: rgba(124, 92, 255, 0.3);
  transform: translateX(4px);
}

.session-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.session-time {
  font-size: 13px;
  color: var(--text-muted);
}

.session-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.session-note {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.session-note.voice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.session-note.voice::before {
  content: '🎤';
  flex-shrink: 0;
}

.session-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.context-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.session-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  opacity: 0;
  transition: opacity 0.2s;
}

.session-card:hover .session-actions {
  opacity: 1;
}

.restore-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.restore-btn:hover {
  background: var(--accent-hover);
}

/* Detail Panel */
.detail-panel {
  width: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  transition: width 0.3s;
  overflow: hidden;
}

.detail-panel.open {
  width: 380px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.detail-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
}

.close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.detail-content {
  padding: var(--space-lg);
  overflow-y: auto;
  height: calc(100vh - 70px);
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-xl);
}

/* Detail Sections */
.detail-section {
  margin-bottom: var(--space-xl);
}

.detail-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}

.detail-note {
  background: var(--bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.tab-favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.tab-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Capture Preview */
.capture-preview {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.capture-preview h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.preview-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.preview-check {
  margin-left: auto;
  color: var(--success);
}

/* Voice Capture */
.voice-capture {
  margin-bottom: var(--space-lg);
}

.voice-capture label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.voice-btn.recording {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.voice-transcript {
  margin-top: var(--space-sm);
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Text Capture */
.text-capture {
  margin-bottom: var(--space-lg);
}

.text-capture label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.text-capture textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.text-capture textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Tag Capture */
.tag-capture {
  margin-bottom: var(--space-lg);
}

.tag-capture label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.tag.add-tag {
  border-style: dashed;
}

/* Interruption Capture */
.interruption-capture label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.interruption-options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.interruption-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.interruption-btn:hover {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
}

.interruption-btn.active {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
}

/* Buttons */
.btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--success);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s;
  z-index: 200;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 18px;
}

.toast-text {
  font-size: 14px;
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
