/* First Nations GP Support Mapping Toolkit Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
}

/* Tab styling */
.tab-btn {
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background-color: #f9fafb;
}

/* Item row animations */
.item-row {
  transition: all 0.2s ease;
  animation: fadeInUp 0.3s ease-out;
}

.item-row:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button hover effects */
button {
  transition: all 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

/* Delete button styling */
.delete-btn {
  transition: all 0.2s ease;
}

.delete-btn:hover {
  transform: scale(1.1);
}

/* Add item button styling */
.add-item-btn {
  transition: all 0.2s ease;
}

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

/* Focus states for accessibility */
button:focus,
textarea:focus,
input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Header styling */
header {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab content sections */
.tab-content h4 {
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

/* Gradient section headers */
.bg-gradient-to-r {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Print optimisation */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .no-print {
    display: none !important;
  }
  
  /* Show all tabs when printing */
  .tab-content.hidden {
    display: block !important;
  }
  
  .tab-content {
    page-break-inside: avoid;
    margin-bottom: 20pt;
  }
  
  h1, h2, h3, h4 {
    page-break-after: avoid;
    color: #000 !important;
  }
  
  .item-row {
    page-break-inside: avoid;
    border: 1pt solid #ccc;
    margin-bottom: 2pt;
  }
  
  /* Hide interactive elements */
  .delete-btn,
  .add-item-btn,
  .tab-btn,
  #save-progress-btn,
  #import-data-btn,
  #print-toolkit-btn,
  #clear-all-btn,
  #submit-complete-btn {
    display: none !important;
  }
  
  /* Ensure proper colours in print */
  .bg-purple-600,
  .bg-blue-600,
  .bg-orange-600,
  .bg-green-600,
  .bg-teal-600 {
    background: #333 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
  }
  
  /* Header and footer adjustments */
  header {
    background: none !important;
    box-shadow: none !important;
    border-bottom: 2pt solid #000;
  }
  
  footer {
    background: none !important;
    color: #000 !important;
    border-top: 1pt solid #ccc;
  }
  
  /* Page breaks */
  .tab-content {
    page-break-before: auto;
  }
  
  h3 {
    page-break-before: always;
  }
  
  h3:first-of-type {
    page-break-before: avoid;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .flex-wrap {
    gap: 0.5rem;
  }
  
  button {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 640px) {
  header .flex {
    flex-direction: column;
    text-align: center;
  }
  
  header .text-right {
    text-align: center;
    margin-top: 1rem;
  }
  
  .item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .item-row .delete-btn {
    align-self: flex-end;
  }
}

/* Notification animations */
.notification {
  transition: transform 0.3s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Section spacing */
.mb-8:last-child {
  margin-bottom: 0;
}

/* Enhanced visual hierarchy */
h1 {
  font-weight: 600;
}

h2 {
  font-weight: 600;
}

h3 {
  font-weight: 600;
}

h4 {
  font-weight: 500;
}

/* Link styling */
a {
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Form elements */
input[type="file"] {
  font-family: inherit;
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .item-row {
    border: 2px solid #000;
  }
  
  button {
    border: 2px solid #000;
  }
}