/**
 * Actionables Dashboard Styles
 * Commitment cards, tabs, and action buttons
 */

.actionables-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 650px;
  margin: 0 auto;
  padding: 0 16px;
  animation: fadeIn 0.2s ease-in;
}

.actionables-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actionables-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

/* Tab navigation */
.actionables-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-button {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -12px;
  padding-bottom: 10px;
}

.tab-button:hover {
  color: var(--text-primary);
}

.tab-button[aria-selected="true"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* Tab panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.15s ease-in;
}

.tab-pane.active {
  display: block;
}

/* Commitments view */
.commitments-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.commitments-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.commitments-summary span {
  display: flex;
  gap: 4px;
  align-items: center;
  font-weight: 500;
}

/* List of commitment cards */
.commitments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual commitment card */
.commitment-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.commitment-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.commitment-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.commitment-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.badge-critical {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.badge-warning {
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-secondary {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
}

.commitment-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.4;
}

.commitment-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.commitment-time {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* Action buttons */
.commitment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.action-button {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.action-button.primary-button:hover {
  opacity: 0.9;
}

.action-button.secondary-button {
  background: var(--surface-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.action-button.secondary-button:hover {
  background: var(--surface-secondary);
  border-color: var(--border-hover);
}

/* Snooze dropdown */
.snooze-dropdown-wrapper {
  position: relative;
}

.snooze-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
  min-width: 160px;
  overflow: hidden;
}

.snooze-menu.hidden {
  display: none;
}

.snooze-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.snooze-option:last-child {
  border-bottom: none;
}

.snooze-option:hover {
  background: var(--surface-hover);
}

/* Empty state */
.commitments-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.commitments-empty p {
  margin: 0;
}

.commitments-empty > p:first-child {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Habits view */
.habits-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.habits-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.habits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.habit-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.habit-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.habit-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.habit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.active-badge {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.paused-badge {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
}

.habit-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  flex: 1;
}

.habit-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.habit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.habit-frequency {
  background: var(--surface-hover);
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.habit-streak {
  font-weight: 600;
}

.habit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Empty states */
.habits-empty,
.nudges-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.habits-empty p,
.nudges-empty p {
  margin: 0;
}

.habits-empty > p:first-child,
.nudges-empty > p:first-child {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
}

/* All Nudges view */
.all-nudges-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nudge-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nudge-group h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nudge-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 4px;
}

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

.nudge-item p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.nudge-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  margin-top: 4px;
}

.nudge-status-badge.pending,
.nudge-status-badge.fired {
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
}

.nudge-status-badge.snoozed {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.nudge-status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.nudge-status-badge.dismissed {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .actionables-dashboard {
    padding: 0 12px;
    gap: 16px;
  }

  .commitment-card,
  .habit-card {
    padding: 12px;
  }

  .commitment-title,
  .habit-title {
    font-size: 15px;
  }

  .commitment-actions,
  .habit-actions {
    gap: 6px;
  }

  .action-button {
    flex: 1;
    min-width: 80px;
  }
}
