/* Book Section Tree Styles */
.section-tree-item {
  transition: all 0.2s ease;
}

.section-tree-item:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-header {
  border-radius: 0.5rem 0.5rem 0 0;
}

.section-children {
  background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
  border-left: 2px solid #E5E7EB;
  margin-left: 1rem;
}

/* Depth-based styling */
.section-tree-item[data-depth="0"] {
  border-left: 4px solid #3B82F6; /* blue-500 */
}

.section-tree-item[data-depth="1"] {
  border-left: 4px solid #10B981; /* green-500 */
}

.section-tree-item[data-depth="2"] {
  border-left: 4px solid #8B5CF6; /* purple-500 */
}

.section-tree-item[data-depth="3"] {
  border-left: 4px solid #F59E0B; /* yellow-500 */
}

/* Section Type Indicators */
.section-type-part {
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
}

.section-type-chapter {
  background: linear-gradient(135deg, #10B981, #047857);
}

.section-type-section {
  background: linear-gradient(135deg, #8B5CF6, #6B46C1);
}

.section-type-subsection {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

/* Collapsible Animation */
.children-container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.children-container.hidden {
  max-height: 0;
  opacity: 0;
}

.children-container:not(.hidden) {
  max-height: 1000px;
  opacity: 1;
}

/* Progress Indicators */
.progress-bar {
  transition: width 0.5s ease;
}

.completion-indicator {
  transition: all 0.3s ease;
}

.completion-indicator.completed {
  background-color: #DCFCE7;
  color: #166534;
}

/* Note Type Styling */
.note-type-definitional {
  background-color: #E0F7FA;
  color: #00695C;
  border-color: #B2EBF2;
}

.note-type-propositional {
  background-color: #E3F2FD;
  color: #1565C0;
  border-color: #BBDEFB;
}

.note-type-critical {
  background-color: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2;
}

.note-type-application {
  background-color: #E8F5E8;
  color: #2E7D32;
  border-color: #C8E6C9;
}

/* Drag and Drop Styling */
.section-tree-item[draggable="true"] {
  cursor: move;
}

.section-tree-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.section-tree-item.drop-target {
  border-top: 3px solid #3B82F6;
  background-color: #EBF8FF;
}

/* Interactive Elements */
.expand-icon {
  transition: transform 0.2s ease;
}

.expand-icon.expanded {
  transform: rotate(90deg);
}

/* Ministry Highlights */
.ministry-highlight {
  background: linear-gradient(to right, #FFF7ED, #FFFBEB);
  border-left: 4px solid #F97316;
  position: relative;
}

.ministry-highlight::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #F97316, #EA580C);
}

.scripture-highlight {
  background: linear-gradient(to right, #EFF6FF, #DBEAFE);
  border-left: 4px solid #3B82F6;
}

/* Quick Action Buttons */
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.quick-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: #3B82F6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563EB;
}

.btn-success {
  background-color: #10B981;
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-warning {
  background-color: #F59E0B;
  color: white;
}

.btn-warning:hover {
  background-color: #D97706;
}

.btn-danger {
  background-color: #EF4444;
  color: white;
}

.btn-danger:hover {
  background-color: #DC2626;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-tree-item {
    margin-bottom: 0.5rem;
  }
  
  .section-children {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
  }
  
  .quick-action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .section-header {
    padding: 0.75rem !important;
  }
}

@media (max-width: 640px) {
  .grid.grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .lg\\:col-span-2 {
    grid-column: span 1 / span 1 !important;
  }
}

/* Print Styles */
@media print {
  .section-tree-item {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
  
  .quick-action-btn,
  .dropdown-menu {
    display: none !important;
  }
  
  .section-children {
    background: none !important;
    border-left: 1px solid #000 !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .section-tree-item,
  .children-container,
  .expand-icon,
  .quick-action-btn {
    transition: none !important;
  }
  
  .loading-shimmer {
    animation: none !important;
  }
}

/* Focus States */
.section-tree-item:focus-within {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.quick-action-btn:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .section-tree-item {
    border: 2px solid #000 !important;
  }
  
  .note-type-definitional,
  .note-type-propositional,
  .note-type-critical,
  .note-type-application {
    border: 2px solid #000 !important;
  }
}
