@tailwind base;
@tailwind components;
@tailwind utilities;

/* Add ReactFlow styles */
.react-flow__node {
  cursor: pointer;
}

.react-flow__node.selected {
  box-shadow: 0 0 0 2px #b92fc5;
}

.react-flow__handle {
  width: 8px !important;
  height: 8px !important;
  background-color: #555 !important;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.react-flow__handle:hover {
  opacity: 1;
}

.react-flow__attribution {
  background: transparent;
  color: rgba(0, 0, 0, 0.5);
}

/* Custom ReactFlow edge styles */
.react-flow__edges {
  z-index: 10;
}

.react-flow__edge {
  pointer-events: none;
}

.react-flow__edge path {
  stroke: #d6d3d1;
  stroke-width: 2px;
}

.react-flow__edge.animated path {
  stroke-dasharray: 5, 5;
  animation: flowEdgeAnimation 1s infinite linear;
}

/* Ensure ReactFlow edge paths are visible */
.react-flow__edge-path {
  stroke: #d6d3d1;
  stroke-width: 2px;
  fill: none;
}

@keyframes flowEdgeAnimation {
  from {
    stroke-dashoffset: 10;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Custom styles */
:root {
  --primary-color: #b92fc5;
  --primary-dark: #931b9e;
  --bg-gradient-start: #f8f9fa;
  --bg-gradient-end: #edf2f7;
  --connection-line: #d6d3d1;
  
  /* Status colors (pastel) */
  --backlog-color: #9c6ade; /* darker purple */
  --todo-color: #f6ad55;    /* orange */
  --in-progress-color: #4299e1; /* blue */
  --done-color: #48bb78;    /* green */
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  min-height: 100vh;
}

@layer components {
  /* Custom card styles */
  .task-card {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-3 transition-all duration-200;
    position: relative;
    z-index: 10;
    width: 100%;
    transition: all 0.2s ease;
    min-height: 150px; /* Ensure consistent minimum height */
  }
  .task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  /* Column styles */
  .board-column {
    @apply bg-white rounded-lg shadow-md flex flex-col;
    min-width: 300px;
    max-width: 350px;
    height: calc(100vh - 200px);
    overflow: hidden;
  }

  .column-header {
    @apply text-gray-700 font-semibold text-lg capitalize px-4 py-3 border-b-2 mb-3;
  }

  .column-header-backlog {
    border-color: var(--backlog-color);
    background-color: #f3e8ff;
  }

  .column-header-todo {
    border-color: var(--todo-color);
    background-color: #ffedd5;
  }

  .column-header-in-progress {
    border-color: var(--in-progress-color);
    background-color: #e0f2fe;
  }

  .column-header-done {
    border-color: var(--done-color);
    background-color: #dcfce7;
  }

  /* Button styles */
  .btn-primary {
    @apply bg-[#b92fc5] text-white px-4 py-2 rounded-md shadow-sm hover:bg-[#931b9e] transition-colors duration-200;
  }

  .btn-secondary {
    @apply bg-white text-gray-700 border border-gray-300 px-4 py-2 rounded-md shadow-sm hover:bg-gray-50 transition-colors duration-200;
  }

  /* Badge styles */
  .status-badge {
    @apply rounded-full px-2 py-0.5 text-xs font-medium inline-flex items-center;
  }

  .status-badge-backlog {
    @apply bg-purple-100 text-purple-800;
  }

  .status-badge-todo {
    @apply bg-orange-100 text-orange-800;
  }

  .status-badge-in-progress {
    @apply bg-blue-100 text-blue-800;
  }

  .status-badge-done {
    @apply bg-green-100 text-green-800;
  }

  /* Subtask indicator */
  .subtask-indicator {
    @apply text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full;
  }
  
  /* Task connection styles */
  .task-connection-line {
    @apply absolute border-2 border-dashed;
    border-color: var(--connection-line);
    z-index: 0;
  }
  
  /* Horizontal connector styles */
  .task-connection-horizontal {
    @apply border-b-2 border-t-0 border-l-0 border-r-0;
    height: 2px;
    width: 20px;
    left: -20px;
    top: 50%;
    transform: translateY(-1px);
  }
  
  /* Vertical connector styles */
  .task-connection-vertical {
    @apply border-l-2 border-t-0 border-b-0 border-r-0;
    width: 2px;
    left: 0;
    transform: translateX(-1px);
  }
  
  /* Connection by status color */
  .connection-backlog {
    border-color: var(--backlog-color);
  }
  
  .connection-todo {
    border-color: var(--todo-color);
  }
  
  .connection-in-progress {
    border-color: var(--in-progress-color);
  }
  
  .connection-done {
    border-color: var(--done-color);
  }
  
  /* Task connection corner pieces */
  .connection-corner {
    @apply absolute w-2 h-2 border-2 border-dashed;
    border-top: none;
    border-right: none;
    border-radius: 0 0 0 4px;
    border-color: var(--connection-line);
    z-index: 0;
  }
  
  .connection-corner-tr {
    border-top: 2px dashed var(--connection-line);
    border-right: 2px dashed var(--connection-line);
    border-left: none;
    border-bottom: none;
    border-radius: 0 4px 0 0;
  }
  
  .connection-corner-bl {
    border-bottom: 2px dashed var(--connection-line);
    border-left: 2px dashed var(--connection-line);
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 4px;
  }
  
  .connection-corner-br {
    border-bottom: 2px dashed var(--connection-line);
    border-right: 2px dashed var(--connection-line);
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
  }
  
  .connection-corner-tl {
    border-top: 2px dashed var(--connection-line);
    border-left: 2px dashed var(--connection-line);
    border-right: none;
    border-bottom: none;
    border-radius: 4px 0 0 0;
  }
  
  .parent-task-indicator {
    @apply inline-flex items-center gap-1 px-1.5 py-0.5 text-xs bg-purple-50 text-purple-700 rounded-sm;
  }
  
  .child-task-marker {
    @apply absolute w-4 h-[2px] bg-[#d6d3d1];
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  .task-relationship-container {
    position: relative;
  }

  /* Board container needs to be positioned relative for absolute connection lines */
  .board-container {
    position: relative;
  }

  /* SVG connection lines */
  svg.absolute {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0; /* Ensure lines appear behind cards */
  }
  
  /* Simplified task card styles */
  .simplified-card {
    @apply py-2 px-3 !important; /* Less padding with !important to ensure override */
    min-height: 60px !important; /* Shorter minimum height with !important to override */
    transition: all 0.2s ease-in-out;
  }
  
  .simplified-card h3 {
    @apply text-sm; /* Smaller title font */
  }
  
  .simplified-card .status-badge {
    @apply text-xs py-0.5 px-1.5; /* Smaller status badges */
  }
  
  /* Quick capture styles */
  .quick-capture-button {
    @apply fixed bottom-8 right-8 w-16 h-16 bg-[#b92fc5] text-white rounded-full shadow-lg flex items-center justify-center;
    z-index: 1000;
    transition: all 0.2s ease-in-out;
  }
  
  .quick-capture-button:hover {
    @apply bg-[#931b9e] transform scale-110;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  }
  
  .quick-capture-button svg {
    @apply w-8 h-8;
  }
  
  .quick-capture-form {
    @apply fixed bottom-8 right-8 bg-white rounded-lg shadow-xl p-4 z-50;
    width: 350px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out forwards;
  }
  
  @keyframes slideUp {
    from {
      transform: translateY(20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Task relationship highlighting styles */
  .task-highlight {
    z-index: 10 !important;
    box-shadow: 0 0 0 2px #b92fc5, 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px) !important;
    filter: brightness(1.05);
    transition: all 0.2s ease-in-out !important;
  }

  .task-dim {
    opacity: 0.5;
    filter: grayscale(20%);
    transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out !important;
  }

  .connection-highlight {
    z-index: 5 !important;
    filter: brightness(1.2);
    stroke-width: 2.5px !important;
    transition: all 0.2s ease-in-out;
  }

  .connection-dim {
    opacity: 0.25;
    filter: grayscale(50%);
    transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out;
  }

  /* Apply highlight effects to calendar view tasks */
  [data-calendar-task-id] {
    transition: transform 0.2s ease-in-out, 
                box-shadow 0.2s ease-in-out, 
                filter 0.2s ease-in-out, 
                opacity 0.2s ease-in-out !important;
  }

  [data-calendar-task-id].task-highlight {
    z-index: 30 !important; /* Higher z-index for calendar view */
  }

  /* Focus button visibility */
  .task-card {
    position: relative; /* Ensure proper positioning for the focus button */
  }

  .focus-button {
    @apply opacity-0 transition-opacity duration-200;
  }
} 