/* Timeline bubbles */
.timeline-bubble-container {
  display: flex;
  flex-direction: column; /* stack bubble on top of label */
  align-items: center;    /* center the label under the bubble */
  flex: 1 0 auto;
  min-width: 60px;
  position: relative;
}

.timeline-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e2e8f0; /* slate-200 */
  color: #1a202c; /* gray-900 */
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s ease;
  z-index: 2;
}
.dark .timeline-bubble {
  background: #475569; /* slate-600 */
  color: #e2e8f0; /* slate-200 */
}

.timeline-bubble.completed {
  background: #22c55e; /* green-500 */
  color: white;
  transform: scale(1.05);
  animation: bubbleFill 0.6s ease forwards;
}
.dark .timeline-bubble.completed {
  background: #16a34a; /* green-600 */
}


.timeline-bubble.active {
  background: #3b82f6; /* blue-500 */
  color: white;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  animation: bubblePulse 1.5s infinite ease-in-out;
}
.dark .timeline-bubble.active {
  background: #2563eb; /* blue-600 */
}

.timeline-bubble.future {
  background: #cbd5e1; /* slate-300 */
  color: #475569; /* slate-600 */
}
.dark .timeline-bubble.future {
  background: #334155; /* slate-700 */
  color: #94a3b8; /* slate-400 */
}


.timeline-label {
  margin-top: 0.5rem;      /* space between bubble and label */
  text-align: center;       /* center the label under the bubble */
  font-size: 0.875rem;
  max-width: 6rem;          /* optional: set a max width */
  white-space: nowrap;       /* prevent wrapping */
  overflow: hidden;          /* hide overflow if too long */
  text-overflow: ellipsis;   /* show "..." if text is too long */
  color: #4b5563; /* gray-600 */
}
.dark .timeline-label {
  color: #9ca3af; /* gray-400 */
}

.timeline-line {
  position: absolute;
  top: 22px;
  left: 50%;
  right: -50%;
  height: 4px;
  background: #cbd5e1; /* slate-300 */
  transition: all 0.5s ease;
  z-index: 1;
}
.dark .timeline-line {
    background: #475569; /* slate-600 */
}

.timeline-line.completed {
  background: #22c55e; /* green-500 */
  animation: lineFill 0.8s ease forwards;
}
.dark .timeline-line.completed {
  background: #16a34a; /* green-600 */
}

@keyframes bubbleFill {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bubblePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes lineFill {
  from { width: 0; }
  to { width: 100%; }
}

/* Enhanced Text Area Styling */
.styled-textarea {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  background-color: #f9fafb; /* gray-50 */
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  color: #1f2937; /* gray-800 */
}

.styled-textarea:focus {
  outline: none;
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  background-color: #ffffff;
}

.dark .styled-textarea {
  background-color: #374151; /* gray-700 */
  border-color: #4b5563; /* gray-600 */
  color: #e5e7eb; /* gray-200 */
}
.dark .styled-textarea::placeholder {
    color: #9ca3af; /* gray-400 */
}

.dark .styled-textarea:focus {
  border-color: #60a5fa; /* blue-400 */
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.4);
  background-color: #4b5563; /* gray-600 */
}

/* Modal Quick Nav Arrows */
.modal-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    background-color: rgba(255, 255, 255, 0.8);
    color: #374151; /* gray-700 */
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: all 0.2s ease-in-out;
}
.dark .modal-nav-arrow {
    background-color: rgba(55, 65, 81, 0.8); /* gray-700 */
    color: #e5e7eb; /* gray-200 */
}

.modal-nav-arrow.left-0 { left: -4rem; }
.modal-nav-arrow.right-0 { right: -4rem; }

.modal-nav-arrow:hover {
    background-color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}
.dark .modal-nav-arrow:hover {
    background-color: #4b5563; /* gray-600 */
}


.modal-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

/* Photo Upload Gallery Styles */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f3f4f6; /* gray-100 */
    border-radius: 8px;
}
.dark .photo-gallery {
    background-color: #374151; /* gray-700 */
}

.photo-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Creates a square aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 1px solid #e5e7eb; /* gray-200 */
}
.dark .photo-thumbnail {
    border-color: #4b5563; /* gray-600 */
}


.photo-thumbnail .delete-photo-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.photo-thumbnail:hover .delete-photo-btn {
    opacity: 1;
}

.upload-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: rgba(0,0,0,0.3);
}
.upload-progress-bar div {
    height: 100%;
    background-color: #3b82f6; /* blue-500 */
    width: 0%;
    transition: width 0.3s ease;
}

/* Stage Completion Checkbox Styling */
.stage-complete-wrapper {
    position: relative;
}

.hidden-checkbox {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
}

.stage-complete-label {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #f3f4f6; /* gray-100 */
    color: #374151; /* gray-700 */
    border: 2px solid #d1d5db; /* gray-300 */
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.dark .stage-complete-label {
    background-color: #374151; /* gray-700 */
    color: #d1d5db; /* gray-300 */
    border-color: #4b5563; /* gray-600 */
}


.stage-complete-label:hover {
    background-color: #e5e7eb; /* gray-200 */
    border-color: #9ca3af; /* gray-400 */
}
.dark .stage-complete-label:hover {
    background-color: #4b5563; /* gray-600 */
    border-color: #6b7280; /* gray-500 */
}

.checkbox-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #9ca3af; /* gray-400 */
    border-radius: 50%;
    margin-right: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .checkbox-icon {
    border-color: #6b7280; /* gray-500 */
}

.hidden-checkbox:checked + .stage-complete-label {
    background-color: #dcfce7; /* green-100 */
    border-color: #22c55e; /* green-500 */
    color: #166534; /* green-800 */
}
.dark .hidden-checkbox:checked + .stage-complete-label {
    background-color: #1f2937; /* gray-900 like dark body */
    border-color: #16a34a; /* green-600 */
    color: #a7f3d0; /* green-200 */
}

.hidden-checkbox:checked + .stage-complete-label .checkbox-icon {
    background-color: #22c55e; /* green-500 */
    border-color: #22c55e; /* green-500 */
}
.dark .hidden-checkbox:checked + .stage-complete-label .checkbox-icon {
    background-color: #16a34a; /* green-600 */
    border-color: #16a34a; /* green-600 */
}

.hidden-checkbox:checked + .stage-complete-label .checkbox-icon::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Toast Notification Styles */
#toast {
    transition: opacity 0.5s ease-in-out;
}
#toast.show {
    opacity: 1;
}
#toast.hide {
    opacity: 0;
}

/* Dark mode overrides for stage color pills (make text darker) */
.dark .bg-blue-100 { background-color: #1e40af; color: #dbeafe; } /* blue-800 bg, blue-100 text */
.dark .bg-purple-100 { background-color: #6b21a8; color: #f3e8ff; } /* purple-800 bg, purple-100 text */
.dark .bg-yellow-100 { background-color: #854d0e; color: #fefce8; } /* yellow-800 bg, yellow-100 text */
.dark .bg-orange-100 { background-color: #9a3412; color: #fff7ed; } /* orange-800 bg, orange-100 text */
.dark .bg-pink-100 { background-color: #9d174d; color: #fce7f3; } /* pink-800 bg, pink-100 text */
.dark .bg-green-100 { background-color: #166534; color: #dcfce7; } /* green-800 bg, green-100 text */
.dark .bg-red-100 { background-color: #991b1b; color: #fee2e2; } /* red-800 bg, red-100 text */
.dark .bg-indigo-100 { background-color: #3730a3; color: #e0e7ff; } /* indigo-800 bg, indigo-100 text */
.dark .bg-teal-100 { background-color: #134e4a; color: #ccfbf1; } /* teal-800 bg, teal-100 text */
.dark .bg-cyan-100 { background-color: #164e63; color: #cffafe; } /* cyan-800 bg, cyan-100 text */
.dark .bg-gray-100 { background-color: #374151; color: #e5e7eb; } /* gray-700 bg, gray-200 text */

/* History Panel Dark Mode */
.dark #historyPanel .bg-gray-400 { background-color: #6b7280; } /* gray-500 */
.dark #historyPanel .ring-white { ring-color: #1f2937; } /* gray-900 */
.dark #historyPanel .bg-gray-200 { background-color: #4b5563; } /* gray-600 */
.dark #historyPanel .text-gray-500 { color: #9ca3af; } /* gray-400 */
.dark #historyPanel .text-gray-900 { color: #e5e7eb; } /* gray-200 */


/* ... existing styles ... */

/* Project Hub/Overview Styles */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.hub-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.dark .hub-card {
    background: #1f2937; /* gray-800 */
    border-color: #374151; /* gray-700 */
}

.hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hub-card h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280; /* gray-500 */
    margin-bottom: 0.75rem;
    font-weight: 600;
}
.dark .hub-card h4 {
    color: #9ca3af; /* gray-400 */
}

.hub-stat {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827; /* gray-900 */
}
.dark .hub-stat {
    color: white;
}

.hub-link {
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: 0.5rem;
    display: inline-block;
}
.hub-link:hover {
    text-decoration: underline;
}

/* Status badge for the Hub */
.hub-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Update Badge Pulse Animation */
#update-badge {
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Update History List Styles */
.update-history-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}
.update-history-item:last-child {
    border-bottom: none;
}
.dark .update-history-item {
    border-color: #374151;
}

.update-history-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}
.dark .update-history-item h4 {
    color: #f3f4f6;
}

.update-history-item .date-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}
.dark .update-history-item .date-label {
    color: #9ca3af;
}

/* Markdown styling inside update content */
#updateContent ul { list-style-type: disc; padding-left: 1.2rem; margin-bottom: 0.5rem; }
#updateContent li { margin-bottom: 0.25rem; }