/* ==========================================================================
   DevPilot-AI - Components CSS (Snippets, Prompts, Habits, Timer, Badges, etc.)
   ========================================================================== */

/* Card Base */
.dev-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dev-card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--shadow-hover);
}

.dev-card-interactive {
  cursor: pointer;
}

.dev-card-interactive:hover {
  transform: translateY(-2px);
}

/* Section Header */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-on-surface);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--color-on-surface-variant);
  margin-top: 0.25rem;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-neutral {
  background-color: var(--color-surface-container);
  color: var(--color-on-surface-variant);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-on-surface-variant);
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  background: var(--color-surface-container);
  color: var(--color-primary);
}

.filter-tab.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Buttons */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-outline-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: var(--color-surface-container);
  border-color: var(--color-outline);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-surface-container);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Global Form Controls */
.form-group {
  margin-bottom: 1.125rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
}

.form-group:last-child {
  margin-bottom: 0 !important;
}

.form-label {
  display: block !important;
  width: 100% !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: var(--color-on-surface-variant) !important;
  margin-bottom: 0.375rem !important;
  line-height: 1.4 !important;
  text-align: left !important;
}

.form-input, .form-textarea, .form-select {
  width: 100% !important;
  display: block !important;
  padding: 0.625rem 0.875rem !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--color-outline-variant) !important;
  background: #ffffff !important;
  color: var(--color-on-surface) !important;
  font-size: 0.875rem !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  transition: all var(--transition-fast) !important;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Code Snippet Vault Cards */
.code-block-wrapper {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #1e293b;
  position: relative;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.75rem;
  color: #94a3b8;
}

.code-block-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.code-dot-red { background: #ef4444; }
.code-dot-yellow { background: #f59e0b; }
.code-dot-green { background: #10b981; }

.code-content {
  padding: 1rem;
  font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', Consolas, Monaco, monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  overflow-x: auto;
  line-height: 1.6;
}

/* Prompt Library Cards */
.prompt-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.prompt-text-box {
  background: var(--color-surface-container-low);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--color-on-surface);
  line-height: 1.6;
  flex-grow: 1;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Habits Tracker Components */
.habit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.habit-item:hover {
  border-color: var(--color-primary-dim);
  background: var(--color-surface-container-low);
}

.habit-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--color-outline);
  cursor: pointer;
  accent-color: var(--color-primary);
}

.progress-bar-container {
  height: 8px;
  background: var(--color-surface-container-high);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Heatmap Grid */
.heatmap-grid {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  transition: transform var(--transition-fast);
}

.heatmap-cell:hover {
  transform: scale(1.2);
  outline: 1px solid var(--color-primary);
}

.heatmap-l0 { background: #e2e8f0; }
.heatmap-l1 { background: #c7d2fe; }
.heatmap-l2 { background: #818cf8; }
.heatmap-l3 { background: #4f46e5; }
.heatmap-l4 { background: #312e81; }

/* Pomodoro Timer Components */
.timer-circle-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-circle-bg {
  fill: none;
  stroke: var(--color-surface-container-high);
  stroke-width: 10;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.timer-time-text {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-on-surface);
  line-height: 1;
}

.timer-mode-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   GLOBAL FLOATING MINI TIMER (Matching DevPilot Timer Card UI)
   ========================================================================== */

.global-floating-timer,
#global-floating-timer {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Top Drag Handle & Bar */
.gft-drag-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem 0.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 1rem 1rem 0 0;
  cursor: grab;
}

.gft-drag-bar:active {
  cursor: grabbing;
}

.gft-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}

.gft-mode-icon {
  font-size: 0.8125rem;
}

.gft-top-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.gft-status-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gft-status-pill.is-live {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.gft-status-pill.is-paused {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.gft-btn-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gft-btn-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Clickable Body */
.gft-body {
  padding: 0.875rem 1rem 0.625rem;
  cursor: pointer;
  background: #ffffff;
  border-radius: 0 0 1rem 1rem;
}

/* Circular Clock Area */
.gft-circle-container {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gft-circle-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gft-circle-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.gft-circle-progress {
  fill: none;
  stroke: #4f46e5;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s ease;
}

.global-floating-timer.is-paused .gft-circle-progress {
  stroke: #f59e0b;
}

.gft-circle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gft-time-display {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.global-floating-timer.is-paused .gft-time-display {
  color: #64748b;
}

.gft-mode-badge {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Task Label Row */
.gft-task-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.5rem;
}

.gft-task-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 230px;
}

/* Controls Row */
.gft-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.gft-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
  transition: all 0.15s ease;
}

.gft-btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.gft-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gft-btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Cycle Row */
.gft-cycle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.35rem 0.35rem;
  border-top: 1px solid #f1f5f9;
}

.gft-cycle-title {
  font-size: 0.625rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gft-cycle-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.gft-cycle-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.gft-cycle-dot.completed {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.gft-cycle-dot.current {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #818cf8;
  box-shadow: 0 0 0 1px #818cf8;
}

.gft-cycle-dot.break {
  font-size: 0.6875rem;
}

/* Footer link */
.gft-footer-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  color: #6366f1;
  font-size: 0.6875rem;
  font-weight: 600;
  border-top: 1px dashed #f1f5f9;
  transition: color 0.15s ease;
}

.gft-footer-hint:hover {
  color: #4338ca;
}

/* ==========================================================================
   GLOBAL HEADER TIMER STATUS INDICATOR
   ========================================================================== */

.global-header-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.08);
  user-select: none;
  white-space: nowrap;
}

.global-header-timer-pill:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.25);
}

.global-header-timer-pill.is-idle {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.global-header-timer-pill.is-idle:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.global-header-timer-pill.is-idle .ght-pulse-dot {
  display: none;
}

.global-header-timer-pill.is-running {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.global-header-timer-pill.is-running:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.3);
}

.global-header-timer-pill.is-paused {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.global-header-timer-pill.is-paused:hover {
  background: #fef3c7;
  border-color: #fcd34d;
}

.ght-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: ght-pulse 2s infinite;
  display: inline-block;
  flex-shrink: 0;
}

.global-header-timer-pill.is-paused .ght-pulse-dot {
  background-color: #f59e0b;
  box-shadow: none;
  animation: none;
}

@keyframes ght-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Sidebar timer badge - strictly hidden across every page */
.sidebar-timer-badge {
  display: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FOR FLOATING TIMER
   ========================================================================== */

@media (max-width: 640px) {
  .global-floating-timer {
    left: 16px !important;
    right: 16px !important;
    bottom: 20px !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 0.875rem;
  }

  .gft-time-display {
    font-size: 1.5rem;
  }

  .gft-ctrl-btn {
    width: 28px;
    height: 28px;
  }
}

/* ==========================================================================
   Dashboard Main Goal & Developer Habits Responsive Styles
   ========================================================================== */

#main-goal-priority-badge {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  max-width: max-content !important;
  line-height: 1.25;
}

#main-goal-priority {
  white-space: nowrap !important;
  display: inline-block;
}

@media (max-width: 640px) {
  #today-main-goal-card {
    padding: 1.25rem !important;
  }

  #main-goal-title {
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
    word-break: break-word;
  }

  #main-goal-priority-badge {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.65rem !important;
  }
}


