/* Resources Section Styles */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Reset container styles */
.container, .grid, section {
  box-sizing: border-box;
}

/* Simplified content handling */
#resources-content {
  box-sizing: border-box;
}

/* Prevent horizontal scrollbars */
body {
  overflow-x: hidden;
}

/* Ensure content fills available space but allows scrolling if needed */
main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Clear explicit height settings that might be causing the border issue */
section#resources {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tab-specific styling */
#resources-tabs button {
  position: relative;
  bottom: -1px; /* Overlap with the content border */
  z-index: 5;
  border-bottom: 1px solid transparent;
}

#resources-tabs button.active {
  border-bottom-color: white;
  background-color: white;
}

/* Fix for resource tabs and content connection */
#resources-tabs {
  margin-bottom: 0;
  padding-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

#resource-content-wrapper {
  min-height: 100px;
  width: 100%;
}
@media (max-width: 768px) {
  html, body {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  /* Adjust tab size and layout on smaller screens */
  #resources-tabs button {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Reduce content padding on mobile */
  #resources-content {
    padding: 1.25rem;
  }
  
  /* Improve typography for mobile */
  #resources-content h1 { font-size: 1.5rem; }
  #resources-content h2 { font-size: 1.3rem; }
  #resources-content h3 { font-size: 1.2rem; }
  
  /* Make pre blocks (code) responsive */
  #resources-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  /* Ensure tables are scrollable on mobile */
  #resources-content .overflow-x-auto {
    margin-bottom: 1rem;
  }
}
  }
  
  .mobile-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border-radius: 50%;
    border: none;
    cursor: pointer;
  }
  
  /* Remove mobile collapsible item rule that's no longer needed */
}
}

/* Fix for list padding in Markdown content */
#resources-content .prose ul,
#resources-content .prose ol {
  padding-left: 1.5rem; /* Add padding to prevent bullets from being cut off */
  margin-bottom: 1rem;
}

/* Improve typography for better readability */
#resources-content h1,
#resources-content h2,
#resources-content h3,
#resources-content h4,
#resources-content .prose h1,
#resources-content .prose h2,
#resources-content .prose h3,
#resources-content .prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

#resources-content h1 { font-size: 1.75rem; }
#resources-content h2 { font-size: 1.5rem; }
#resources-content h3 { font-size: 1.25rem; }

#resources-content p {
  margin-bottom: 1rem;
}

/* Add spacing between paragraphs and lists */
#resources-content p + ul,
#resources-content p + ol {
  margin-top: -0.5rem;
}

/* Resources tabs styling */
#resources-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
}

/* Resource content container - no card styling, just a plain container with border */
#resources-content {
  background-color: white;
  padding: 2rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.25rem;
  min-height: 100px; /* Reduced from 300px */
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  height: auto !important; /* Override any height constraints */
  display: block; /* Use block display for natural content height */
  flex: 1; /* Fill available space in flex parent */
  overflow: visible; /* Ensure content isn't cut off */
}

/* Make empty resource content container not visible */
#resources-content:empty {
  display: none;
  border: none;
  min-height: 0;
}

/* Additional responsive styles for markdown content */
#resources-content img {
  max-width: 100%;
  height: auto;
}

#resources-content table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

#resources-content code, 
#resources-content pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Mobile popup styles */
.mobile-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.mobile-popup-content {
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  max-height: 100%;
  position: relative;
}

.mobile-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e5e5e5;
}

.mobile-popup-title {
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
}

.mobile-popup-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
