/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Loading spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Turbo loading indicator */
.turbo-progress-bar {
  background-color: #6366f1;
}

/* =========================================
   Horizontal Columns Layout (V2)
   ========================================= */

/* Container wrapper */
.columns-wrapper {
  position: relative;
  height: calc(100vh - 120px);
  min-height: 400px;
}

/* CSS Grid for horizontal columns */
.columns-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 280px);
  gap: 0;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* Custom scrollbar for webkit browsers */
.columns-grid::-webkit-scrollbar {
  height: 8px;
}

.columns-grid::-webkit-scrollbar-track {
  background: transparent;
}

.columns-grid::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 4px;
}

.columns-grid::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* Individual column styling */
.column {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 280px;
  height: 100%;
  background-color: #ffffff;
}

/* Column border separator */
.column-separator {
  border-right: 1px solid #e5e7eb;
}

.column-separator:last-child {
  border-right: none;
}

/* Current/active column highlight */
.column-current {
  background-color: #fffbeb;
}

.column-current .column-header {
  background-color: #fef3c7;
  border-bottom-color: #fcd34d;
}

/* Column header */
.column-header {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

/* Column items container */
.column-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Column footer with add button */
.column-footer {
  flex-shrink: 0;
  padding: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Add button styling */
.column-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  background-color: transparent;
  border: 1px dashed #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.column-add-btn:hover {
  color: #4f46e5;
  border-color: #4f46e5;
  background-color: #eef2ff;
}

/* Goal item in column */
.column-goal-item {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.column-goal-item:hover {
  border-color: #c7d2fe;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.column-goal-item.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Goal with parent - visual connection styling */
.column-goal-item.has-parent {
  border-left: 3px solid #c7d2fe;
  padding-left: 0.625rem;
}

.column-goal-item.has-parent:hover {
  border-left-color: #818cf8;
}

/* Goal with color label */
.column-goal-item.has-color {
  border-left: 3px solid;
  padding-left: 0.625rem;
}

/* When goal has both color and parent, color takes precedence for border */
.column-goal-item.has-color.has-parent {
  /* Color border style already set by inline style */
}

/* Color option buttons in detail panel */
.color-option {
  cursor: pointer;
}

.color-option:focus {
  outline: none;
}

.color-option.color-selected {
  transform: scale(1.1);
}

/* Parent link styling with connection indicator */
.parent-link {
  position: relative;
  padding-left: 0.25rem;
}

.parent-link::before {
  content: '';
  position: absolute;
  left: -0.625rem;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background-color: #c7d2fe;
}

.parent-link a {
  display: inline-flex;
  max-width: 100%;
}

.parent-link a:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(139, 92, 246, 0.05);
  border-radius: 0.25rem;
}

/* Column Progress Bar */
.column-progress-bar {
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.column-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Progress color states */
.column-progress-fill.progress-green {
  background-color: #22c55e;
}

.column-progress-fill.progress-yellow {
  background-color: #eab308;
}

.column-progress-fill.progress-red {
  background-color: #ef4444;
}

.column-progress-fill.progress-neutral {
  background-color: #d1d5db;
}

/* =========================================
   Drag and Drop Styles (V2-10)
   ========================================= */

/* Drag handle - hidden by default, shown on hover */
.drag-handle {
  opacity: 0;
  cursor: grab;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
}

.drag-handle:hover {
  background-color: #f3f4f6;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Show drag handle on goal item hover */
.column-goal-item:hover .drag-handle {
  opacity: 1;
}

/* Force show handle on touch devices */
@media (hover: none) {
  .drag-handle {
    opacity: 0.5;
  }
}

/* Dragging state for the goal item */
.column-goal-item.is-dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: #a5b4fc;
  background-color: #eef2ff;
}

/* Ghost preview styling */
.drag-ghost {
  background-color: #ffffff;
  border: 1px solid #818cf8;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Touch-specific ghost styling */
.drag-ghost.touch-ghost {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Prevent text selection while dragging */
.column-goal-item[draggable="true"] {
  user-select: none;
  -webkit-user-select: none;
}

/* Transition for smooth visual feedback */
.column-goal-item[data-draggable="true"] {
  transition: opacity 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

/* =========================================
   Drop Zone Styles (V2-11)
   ========================================= */

/* Active drop zone - column container */
.column.drop-zone-active {
  background-color: #fefce8;
  border-color: #fde047;
}

.column.drop-zone-active .column-header {
  background-color: #fef9c3;
  border-bottom-color: #facc15;
}

/* Drop zone highlight for items container */
.column-items.drop-zone-highlight {
  background-color: rgba(253, 224, 71, 0.1);
  border: 2px dashed #facc15;
  border-radius: 0.375rem;
  min-height: 100px;
  transition: all 0.15s ease;
}

/* Expand effect when dragging over */
.column.drop-zone-active .column-items {
  min-height: 120px;
}

/* Drop zone indicator text (visual hint) */
.column.drop-zone-active::after {
  content: '';
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border: 2px dashed #fbbf24;
  border-radius: 50%;
  opacity: 0.5;
  animation: pulse-drop 1s ease-in-out infinite;
}

@keyframes pulse-drop {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translateX(-50%) scale(1.1);
    opacity: 0.6;
  }
}

/* Column needs position relative for pseudo-element */
.column[data-controller="drop-zone"] {
  position: relative;
}

/* =========================================
   Drop Zone Insertion Line Indicators
   ========================================= */

[data-drag-goal-id-value],
[data-goal-id] {
  position: relative;
}

:is([data-drag-goal-id-value], [data-goal-id]).drop-before::before,
:is([data-drag-goal-id-value], [data-goal-id]).drop-after::after,
.drop-empty-indicator {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #818cf8 0%, #a78bfa 50%, #818cf8 100%);
  border-radius: 2px;
  z-index: 10;
  animation: insertion-pulse 1s ease-in-out infinite;
}

:is([data-drag-goal-id-value], [data-goal-id]).drop-before::before { top: -4px; }
:is([data-drag-goal-id-value], [data-goal-id]).drop-after::after { bottom: -4px; }

.drop-empty-indicator {
  position: static;
  margin: 0.5rem 0;
}

/* =========================================
   Goal Move Animations (V2-13)
   ========================================= */

/* Goal moving animation */
.column-goal-item.goal-moving {
  animation: goal-move 0.3s ease;
}

@keyframes goal-move {
  0% {
    opacity: 0.5;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Rollback animation */
.column-goal-item.goal-rollback {
  animation: goal-rollback 0.5s ease;
}

@keyframes goal-rollback {
  0% {
    background-color: #fef2f2;
    border-color: #ef4444;
  }
  50% {
    background-color: #fee2e2;
    border-color: #f87171;
  }
  100% {
    background-color: #ffffff;
    border-color: #e5e7eb;
  }
}

/* =========================================
   Flash Messages (V2-13)
   ========================================= */

.flash-message {
  animation: flash-slide-in 0.3s ease;
}

@keyframes flash-slide-in {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.flash-message.flash-fade-out {
  animation: flash-fade-out 0.3s ease forwards;
}

@keyframes flash-fade-out {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* =========================================
   Within-Column Reordering (V2-14)
   ========================================= */

/* Insertion indicator line */
.column-goal-item.drop-before::before,
.column-goal-item.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #818cf8 0%, #a78bfa 50%, #818cf8 100%);
  border-radius: 2px;
  z-index: 10;
  animation: insertion-pulse 1s ease-in-out infinite;
}

.column-goal-item.drop-before::before {
  top: -5px;
}

.column-goal-item.drop-after::after {
  bottom: -5px;
}

/* Goal items need position relative for insertion indicator */
.column-goal-item {
  position: relative;
}

/* Pulse animation for insertion indicator */
@keyframes insertion-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scaleX(0.95);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* Highlight goal when dragging over it */
.column-goal-item.drag-over {
  background-color: #f5f3ff;
  border-color: #a78bfa;
}

/* Reordering transition for smooth position updates */
.column-goal-item.reordering {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Same-column drag indicator (different from cross-column) */
.column-items.reorder-active {
  background-color: rgba(167, 139, 250, 0.05);
}

/* =========================================
   Keyboard Navigation (V2-15)
   ========================================= */

/* Focus ring for keyboard-selected goal */
.column-goal-item.keyboard-selected {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Ensure focus outline is visible on all states */
.column-goal-item.keyboard-selected:hover {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Focus-visible fallback for native focus */
.column-goal-item:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Remove default focus outline as we use custom styling */
.column-goal-item:focus {
  outline: none;
}

/* Keyboard selected + completed state */
.column-goal-item.keyboard-selected.completed {
  opacity: 0.8;
}

/* Timeline keyboard navigation (V2-58) */
.keyboard-column-selected {
  /* Subtle gray outline for column selection */
  outline: 1px solid #d1d5db;
  outline-offset: -1px;
}

.keyboard-section-selected {
  /* Very subtle section highlight - only shown when section has no items */
  background: rgba(107, 114, 128, 0.05);
  border-radius: 0.375rem;
}

/* Timeline goal keyboard selected state */
[data-timeline-keyboard-target="goal"].keyboard-selected {
  outline: 1px solid #9ca3af;
  outline-offset: 1px;
  border-radius: 0.25rem;
  background: rgba(107, 114, 128, 0.08);
}

/* =========================================
   Go-to Navigation Indicator (V2-16)
   ========================================= */

/* Go-to indicator container */
.goto-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

/* Hidden state */
.goto-indicator.hidden {
  display: none;
}

/* Visible state with animation */
.goto-indicator.goto-indicator-visible {
  display: block;
  animation: goto-slide-up 0.15s ease-out;
}

@keyframes goto-slide-up {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Indicator content container */
.goto-indicator-content {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* "g +" prefix text */
.goto-indicator-prefix {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.05em;
}

/* Keys container */
.goto-indicator-keys {
  display: grid;
  grid-template-columns: repeat(6, auto auto);
  gap: 4px 12px;
  align-items: center;
}

/* Individual key badge */
.goto-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e0e7ff;
  transition: all 0.1s ease;
}

/* Key label text */
.goto-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Active key highlight (when pressed) */
.goto-key.goto-key-active {
  background: #6366f1;
  border-color: #818cf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
  transform: scale(1.1);
}

/* =========================================
   Delete Confirmation Modal (V2-17)
   ========================================= */

/* Modal visible animation */
#delete-confirmation-modal.delete-modal-visible {
  animation: modal-fade-in 0.15s ease-out;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal panel animation */
#delete-confirmation-modal .relative {
  animation: modal-slide-up 0.2s ease-out;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================
   Keyboard Shortcuts Help Modal (V2-18)
   ========================================= */

/* Help modal visible animation */
#help-modal:not(.hidden) {
  animation: modal-fade-in 0.15s ease-out;
}

#help-modal:not(.hidden) > div:last-child > div {
  animation: modal-slide-up 0.2s ease-out;
}

/* Shortcut row styling */
.shortcut-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0;
}

/* Keyboard key styling */
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

/* Shortcut description */
.shortcut-desc {
  font-size: 0.875rem;
  color: #4b5563;
}

/* Help link button in header */
.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.15s ease;
}

.help-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.help-link:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* =========================================
   Detail Panel (V2-19)
   ========================================= */

/* Backdrop animation */
.detail-panel-backdrop {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.detail-panel-visible .detail-panel-backdrop {
  opacity: 1;
}

.detail-panel-closing .detail-panel-backdrop {
  opacity: 0;
}

/* Panel slide-in animation */
.detail-panel-content {
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
}

.detail-panel-visible .detail-panel-content {
  transform: translateX(0);
}

.detail-panel-closing .detail-panel-content {
  transform: translateX(100%);
}

/* Prevent body scroll when panel is open */
body.detail-panel-open {
  overflow: hidden;
}

/* Panel responsive width - approximately 40% on larger screens */
@media (min-width: 1024px) {
  .detail-panel-content {
    width: 40vw;
    max-width: 600px;
    min-width: 400px;
  }
}

@media (min-width: 1280px) {
  .detail-panel-content {
    width: 35vw;
    max-width: 700px;
  }
}

/* Panel inner content styling */
#detail-panel-content {
  min-height: 200px;
}

/* Loading state for panel content */
#detail-panel-content .loading-spinner {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

/* =========================================
   V2-21: Inline Editing in Detail Panel
   ========================================= */

/* Inline edit field - shows edit hint on hover */
.inline-edit-field {
  position: relative;
}

.inline-edit-field::after {
  content: "✎";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 0.875rem;
  color: #9ca3af;
}

.inline-edit-field:hover::after {
  opacity: 1;
}

/* Hide edit hint when field has placeholder text */
.inline-edit-field:has(.text-gray-400)::after {
  content: none;
}

/* Input/textarea focus styling */
.goal-detail input:focus,
.goal-detail textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* Smooth transition when switching between display and edit mode */
.goal-detail input,
.goal-detail textarea {
  transition: opacity 0.15s ease;
}

/* Hide the hidden class explicitly */
.goal-detail .hidden {
  display: none !important;
}

/* =========================================
   V2-22: AI Decompose Button in Detail Panel
   ========================================= */

/* Suggestion item styling */
.suggestion-item {
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  border-color: #a78bfa;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

/* Suggestion removal animation */
.suggestion-item.removing {
  animation: suggestion-remove 0.3s ease forwards;
}

@keyframes suggestion-remove {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}

/* Loading spinner animation (already using animate-spin from Tailwind) */
.decompose-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #6b7280;
}

.decompose-loading svg {
  animation: spin 1s linear infinite;
  color: #7c3aed;
}

/* Success state animation */
.decompose-success {
  animation: success-pop 0.5s ease;
}

@keyframes success-pop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Button loading state */
button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Flash container for suggestion acceptance */
#flash-container .flash-message {
  animation: flash-slide-in 0.3s ease;
}

#flash-container .flash-success {
  animation-delay: 0s;
}

/* =========================================
   Inbox View (V2-23)
   ========================================= */

/* Beautiful background for inbox page */
.inbox-background {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

/* Add subtle pattern overlay */
.inbox-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
  pointer-events: none;
}

/* Animated floating shapes in background */
.inbox-background::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 60%);
  animation: inbox-float 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes inbox-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* Centered card styling */
.inbox-card {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: inbox-card-appear 0.4s ease-out;
}

@keyframes inbox-card-appear {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Inbox item hover effect */
.inbox-item {
  transition: all 0.2s ease;
}

.inbox-item:hover {
  transform: translateX(4px);
}

/* Inbox item drag styling */
.inbox-item.is-dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: #a5b4fc;
  background-color: #eef2ff;
}



/* =========================================
   Inbox Drawer (V2-25)
   ========================================= */

/* Drawer toggle button */
.inbox-drawer-toggle {
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

.inbox-drawer-toggle:hover {
  box-shadow: 0 6px 25px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}

/* Drawer panel */
.inbox-drawer {
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

/* Drawer item styling */
.inbox-drawer-item {
  transition: all 0.15s ease;
}

.inbox-drawer-item:hover {
  background-color: #f5f3ff;
}

.inbox-drawer-item.is-dragging {
  opacity: 0.4;
  background-color: #eef2ff;
  border-style: dashed;
  border-color: #a5b4fc;
}

/* Drawer item drag ghost */
.inbox-drawer-item.drag-ghost {
  background-color: white;
  border: 2px solid #6366f1;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

/* =========================================
   Command Palette (V2-26)
   ========================================= */

/* Command palette modal visibility */
#command-palette-modal.command-palette-visible {
  animation: modal-fade-in 0.15s ease-out;
}

#command-palette-modal.command-palette-closing {
  animation: modal-fade-out 0.15s ease-out;
}

@keyframes modal-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Prevent body scroll when palette is open */
body.command-palette-open {
  overflow: hidden;
}

/* Backdrop styling */
.command-palette-backdrop {
  backdrop-filter: blur(4px);
}

#command-palette-modal.command-palette-visible .command-palette-backdrop {
  opacity: 1;
}

#command-palette-modal.command-palette-closing .command-palette-backdrop {
  opacity: 0;
}

/* Panel styling */
.command-palette-panel {
  animation: palette-slide-up 0.2s ease-out;
}

#command-palette-modal.command-palette-closing .command-palette-panel {
  animation: palette-slide-down 0.15s ease-out;
}

@keyframes palette-slide-up {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes palette-slide-down {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

/* Header input styling */
.command-palette-header {
  background-color: #f9fafb;
}

.command-palette-header input::placeholder {
  color: #9ca3af;
}

/* Results container */
.command-palette-results {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.command-palette-results::-webkit-scrollbar {
  width: 6px;
}

.command-palette-results::-webkit-scrollbar-track {
  background: transparent;
}

.command-palette-results::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}

/* Section header */
.command-palette-section {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Individual item */
.command-palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.command-palette-item:hover {
  background-color: #f3f4f6;
}

/* Selected item */
.command-palette-item.command-palette-item-selected {
  background-color: #eef2ff;
}

.command-palette-item.command-palette-item-selected .command-palette-item-icon {
  color: #6366f1;
}

/* Item icon */
.command-palette-item-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  color: #6b7280;
  transition: all 0.1s ease;
}

.command-palette-item.command-palette-item-selected .command-palette-item-icon {
  background-color: #e0e7ff;
}

/* Item content */
.command-palette-item-content {
  flex: 1;
  min-width: 0;
}

.command-palette-item-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.command-palette-item-desc {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer styling */
.command-palette-footer {
  background-color: #f9fafb;
}

/* Small keyboard key styling for footer */
.shortcut-key-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.625rem;
  font-weight: 600;
  color: #374151;
}

/* Platform-specific key display */
.mac-key {
  display: none;
}

.win-key {
  display: inline;
}

/* Show Mac key on Mac, hide Windows key */
@supports (-webkit-touch-callout: none) {
  .mac-key {
    display: inline;
  }
  .win-key {
    display: none;
  }
}

/* For actual Mac detection via JS, use these classes */
body.is-mac .mac-key {
  display: inline;
}

body.is-mac .win-key {
  display: none;
}

body:not(.is-mac) .mac-key {
  display: none;
}

body:not(.is-mac) .win-key {
  display: inline;
}

/* =========================================
   Mobile Responsive (V2-32)
   ========================================= */

/* Touch-friendly targets for mobile */
.touch-target {
  /* Ensure minimum 44px touch target */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Goal checkbox button - no visible focus/hover effects */
.column-goal-item .touch-target:focus,
.column-goal-item .touch-target:hover,
.column-goal-item .touch-target:focus-visible {
  outline: none;
  box-shadow: none;
  transform: none;
}

/* Mobile sidebar slide animation */
@media (max-width: 1023px) {
  /* Sidebar slide-in animation */
  [data-sidebar-target="sidebar"] {
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
  }

  [data-sidebar-target="sidebar"].flex {
    transform: translateX(0);
  }

  /* Overlay fade animation */
  [data-sidebar-target="overlay"] {
    opacity: 0;
    transition: opacity 0.3s ease-out;
  }

  [data-sidebar-target="overlay"]:not(.hidden) {
    opacity: 1;
  }

  /* Adjust content margin on mobile - no sidebar margin */
  .lg\\:ml-64 {
    margin-left: 0 !important;
  }

  /* Full-height mobile scroll for columns */
  .columns-wrapper {
    height: calc(100vh - 80px);
    min-height: 300px;
  }

  /* Single column view hint - show swipe indicator */
  .columns-grid::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
    z-index: 1;
  }

  /* Ensure columns are touch-scrollable */
  .columns-grid {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding: 0.5rem;
  }

  /* Snap columns to edges on mobile */
  .column {
    scroll-snap-align: start;
    min-width: 85vw;
    max-width: 90vw;
  }

  /* Larger add button for mobile */
  .column-add-btn {
    min-height: 48px;
    font-size: 1rem;
  }

  /* Hide keyboard hints on mobile */
  .shortcut-key,
  .shortcut-key-small {
    display: none;
  }
}

/* Detail panel full-screen on mobile */
@media (max-width: 639px) {
  .detail-panel-content {
    width: 100vw !important;
    max-width: none !important;
    min-width: auto !important;
  }

  /* Remove the left padding on mobile for full-width panel */
  #detail-panel .fixed.inset-y-0.right-0 {
    padding-left: 0;
  }

  /* Adjust panel header for mobile */
  .detail-panel-content .flex.items-center.justify-between {
    padding: 1rem;
  }
}

/* Tablet adjustments */
@media (min-width: 640px) and (max-width: 1023px) {
  .column {
    min-width: 280px;
    max-width: 320px;
  }
}

/* Improved drag handle visibility on touch devices */
@media (hover: none) and (pointer: coarse) {
  .drag-handle {
    opacity: 0.6;
    padding: 0.5rem;
  }

  /* Larger drag icon on touch */
  .drag-handle svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* Ensure goal items have enough spacing for touch */
  .column-goal-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }
}

/* =========================================
   V2-33: Progress Animations and Micro-interactions
   ========================================= */

/* Progress bar update animation - pulse effect when value changes */
.column-progress-fill.progress-update-pulse {
  animation: progress-update-pulse 0.6s ease-out;
}

@keyframes progress-update-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 8px 2px currentColor;
    opacity: 0.8;
  }
  100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
}

/* Checkmark pop animation on task completion */
.check-animation {
  animation: check-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes check-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Checkmark container for proper animation origin */
.check-container {
  display: inline-flex;
  transform-origin: center;
}

/* Task completion strikethrough animation */
.task-complete-strikethrough {
  animation: strikethrough 0.3s ease-out forwards;
}

@keyframes strikethrough {
  0% {
    text-decoration-color: transparent;
  }
  100% {
    text-decoration-color: currentColor;
  }
}

/* Hover lift effect for buttons and interactive elements */
.hover-lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-lift:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hover-lift:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Focus ring animation for keyboard navigation */
.focus-ring-animation {
  transition: box-shadow 0.2s ease, outline 0.2s ease;
}

.focus-ring-animation:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
  animation: focus-ring-appear 0.2s ease-out;
}

@keyframes focus-ring-appear {
  0% {
    outline-offset: 0;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  100% {
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
  }
}

/* Column add button hover animation */
.column-add-btn {
  transition: all 0.2s ease;
}

.column-add-btn:hover {
  transform: translateY(-1px);
}

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

/* Goal item entry animation (when added to column) */
.goal-item-enter {
  animation: goal-item-enter 0.3s ease-out;
}

@keyframes goal-item-enter {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Goal item completion fade */
.goal-item-complete {
  animation: goal-item-complete 0.4s ease-out forwards;
}

@keyframes goal-item-complete {
  0% {
    background-color: #ffffff;
  }
  30% {
    background-color: #dcfce7;
  }
  100% {
    background-color: #ffffff;
  }
}

/* Smooth scrollbar appearance */
.columns-grid {
  scroll-behavior: smooth;
}

/* Enhanced column item transitions */
.column-goal-item {
  transition: all 0.2s ease, transform 0.15s ease;
}

/* No shift on hover - keeping goal stable */

/* Color border pulse on hover for colored goals */
.column-goal-item.has-color:hover {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress count update animation */
.progress-count-update {
  animation: count-update 0.3s ease-out;
}

@keyframes count-update {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    color: #22c55e;
  }
  100% {
    transform: scale(1);
  }
}

/* Badge pulse animation for updates */
.badge-pulse {
  animation: badge-pulse 0.5s ease-out;
}

@keyframes badge-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px transparent;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
}

/* =========================================
   View Transitions API - Column Navigation
   ========================================= */

/* Enable view transitions for horizons page navigation */
@view-transition {
  navigation: auto;
}

/* Custom animations for each column */
::view-transition-old(column-year),
::view-transition-old(column-month),
::view-transition-old(column-week),
::view-transition-old(column-day) {
  animation: column-slide-out 0.25s ease-out both;
}

::view-transition-new(column-year),
::view-transition-new(column-month),
::view-transition-new(column-week),
::view-transition-new(column-day) {
  animation: column-slide-in 0.25s ease-out both;
}

@keyframes column-slide-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes column-slide-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Stagger the column animations for a cascade effect */
::view-transition-old(column-year) { animation-delay: 0ms; }
::view-transition-new(column-year) { animation-delay: 0ms; }

::view-transition-old(column-month) { animation-delay: 50ms; }
::view-transition-new(column-month) { animation-delay: 50ms; }

::view-transition-old(column-week) { animation-delay: 100ms; }
::view-transition-new(column-week) { animation-delay: 100ms; }

::view-transition-old(column-day) { animation-delay: 150ms; }
::view-transition-new(column-day) { animation-delay: 150ms; }

/* Smooth crossfade for the root (page background) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.2s;
}

/* =========================================
   Timeline Goal Hover in Current Section
   ========================================= */

/* Override gray hover with purple when goal is in a current (purple) section */
.bg-purple-50 [data-timeline-keyboard-target="goal"]:hover {
  background-color: #e9d5ff; /* purple-200 */
}

/* =========================================
   Timeline Section Add Button
   ========================================= */

/* Hide by default, show on section hover */
.section-add-btn {
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.month-section:hover .section-add-btn,
.week-section:hover .section-add-btn,
.day-section:hover .section-add-btn,
.quarter-section:hover .section-add-btn,
.year-section:hover .section-add-btn,
.unscheduled-section:hover .section-add-btn {
  opacity: 1;
}

/* Purple background for Add button when in current (purple) section */
.bg-purple-50 .section-add-btn {
  background-color: #e9d5ff !important; /* purple-200 */
}

.bg-purple-50 .section-add-btn:hover {
  background-color: #d8b4fe !important; /* purple-300 */
}

/* =========================================
   Accessibility: Reduced Motion
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  /* Disable all animations for users who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .column-progress-fill {
    transition: none !important;
  }

  .detail-panel-content {
    transition: none !important;
  }

  .check-animation,
  .progress-update-pulse,
  .goal-item-enter,
  .goal-item-complete,
  .hover-lift,
  .badge-pulse {
    animation: none !important;
  }

  /* Disable view transitions for reduced motion */
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
