/*--------------------------------------------------------------
# Saved Items Section (moved from style.css)
--------------------------------------------------------------*/
.city-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.city-btn {
    padding: 0.5rem 1rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
}
/*--------------------------------------------------------------
# Resource Card Styles (moved from style.css)
--------------------------------------------------------------*/
.resource-card,
.coworking-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
}

.resource-card:hover,
.coworking-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-badges {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-description {
    font-size: 0.875rem;
}

.card-content {
    padding: 1.5rem;
}

.card-details {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-details p {
    margin-bottom: 0.25rem;
}

.card-title a, .card-details a, .btn-outline a {
    color: inherit;
}

.card-title a img, .card-details a img {
    margin: 0px 5px 1px 0px;
    vertical-align: middle;
}

.card-description {
    color: var(--bs-body-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.card-details strong {
    margin-right: 4px;
}

.card-header {
    padding: 0.5rem 0.5rem 0.5rem 1rem;
}
/*--------------------------------------------------------------
# Badge Styles (moved from style.css)
--------------------------------------------------------------*/
.badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: calc(var(--radius) - 2px);
    text-transform: uppercase;
}

.badge-outline {
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
}

.badge-secondary {
  background-color: hsl(var(--muted-foreground));
  border: solid 1px hsl(var(--muted-foreground));
  color: hsl(var(--background));
  margin: 0 0.5rem 0.5rem 0;
  transition: var(--transition);
}

.badge-secondary:hover,
.btn-outline:hover {
  border-color: hsl(var(--primary));
}

/* Tag links should look like badges but be clickable */
.tag-link {
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.tag-link:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  text-decoration: none;
}
/*--------------------------------------------------------------
# Resource Hub Styles (merged from resourcehub.css)
--------------------------------------------------------------*/
@media (min-width: 769px) {
    /* Show full title on desktop - no truncation needed */
    .resourcehub-section-title::before {
        content: attr(title);
    }
}

/*--------------------------------------------------------------
# Feed Styles (merged from feed.css)
--------------------------------------------------------------*/
.feed_image {
  max-height: 200px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
}

/* Resource Section Layout */
.resource-section {
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.view-all-link {
  font-size: 1rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0rem 0.6rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s ease;
  margin-right: 1rem;
}

.view-all-link:hover {
  cursor: pointer;
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  text-decoration: none;
  opacity: 0.9;
}

.resource-scroll-wrapper {
  position: relative;
  display: flex;
}

.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: hsl(var(--background));
  border: 2px solid hsl(var(--muted-foreground));
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.scroll-arrow.scroll-left {
  left: 20px;
}

.scroll-arrow.scroll-right {
  right: 20px;
}

.scroll-arrow:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--background));
  transform: translateY(-50%) scale(1.1);
}

.scroll-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
}

.resource-scroll-container {
  overflow: hidden;
  flex: 1;
  position: relative;
  width: calc(3 * 300px + 2 * 1.5rem); /* Only 3 full cards + gaps, no peek of 4th card */
  margin: 0 80px; /* Increased margin to account for better arrow positioning */
  padding: 0; /* Remove all padding */
}

.resource-grid {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.3s ease;
  width: max-content;
}

.resource-card {
  flex: 0 0 300px;
  min-width: 300px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resource-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resource-card .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resource-card .card-text {
  flex: 1;
  overflow: hidden;
}

/* Show All Card Styling */
.show-all-card {
  justify-content: center;
  background: linear-gradient(135deg, hsl(var(--muted)), hsl(var(--muted-foreground) / 0.1));
  border: 2px dashed hsl(var(--primary));
  transition: opacity 0.2s ease;
}

/* Make show-all-card lighter when loading indicator is present */
.events-grid:has(.loading-indicator) .show-all-card,
.incubators-grid:has(.loading-indicator) .show-all-card,
.reports-grid:has(.loading-indicator) .show-all-card,
#event-content:has(.loading-indicator) .show-all-card,
#incubator-content:has(.loading-indicator) .show-all-card,
#report-content:has(.loading-indicator) .show-all-card {
  opacity: 0.2;
}

.show-all-content {
  text-align: center;
}

.show-all-link {
  width: 100%;
  background-color: hsl(var(--primary));
  color: hsl(var(--foreground));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: inline-block;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.show-all-content .card-title {
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.show-all-content .card-description {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.show-all-content .btn-primary a {
  color: hsl(var(--background));
}

/* Notes Section */
.notes {
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  opacity: 0.7;
  padding: 0rem 1rem 1rem 1rem
}

.quote {
  line-height: 1;
  color: #212529;
  opacity: 0.8;
  font-size: 1rem;
}

.pagination {
  --bs-pagination-padding-x: 0.75rem;
  --bs-pagination-padding-y: 0.375rem;
  --bs-pagination-font-size: 1rem;
  --bs-pagination-color: #0d6efd;
  --bs-pagination-bg: #fff;
  --bs-pagination-border-width: 1px;
  --bs-pagination-border-color: #dee2e6;
  --bs-pagination-border-radius: 0.375rem;
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: #0d6efd;
  --bs-pagination-active-border-color: #0d6efd;
  --bs-pagination-disabled-color: rgba(33, 37, 41, 0.75);
  --bs-pagination-disabled-bg: #343a40;
  --bs-pagination-disabled-border-color: #495057;
  display: flex;
  padding-left: 0;
  list-style: none;
  margin-top: 0.5rem;
}

.page-link {
  position: relative;
  padding: 0.375rem 0.75rem;
  text-decoration: none;
  background-color: #fff;
  transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.page-item:first-child .page-link {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.bi-bookmark {
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: var(--transition);
  font-size: 1.125rem;
}

.bi-bookmark:hover {
  color: hsl(var(--primary));
  transform: scale(1.1);
}

.bi-bookmark-fill {
  cursor: pointer;
  font-size: 1.125rem;
  color: hsl(var(--primary));
  text-shadow: 1px 1px 0 hsl(var(--border)), -1px -1px 0 hsl(var(--border)), 1px -1px 0 hsl(var(--border)), -1px 1px 0 hsl(var(--border));
}

/* Section-specific saved counters */
.saved-count {
  display: inline-block;
  padding: 0.15rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  vertical-align: text-bottom;
}

.saved-count:hover, .city-btn:hover {
  border-color: hsl(var(--primary));
}

.saved-count.active, .city-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}


.saved-count i {
  font-size: 0.9rem;
  margin-right: 0.25rem;
}

.saved-count .count-badge {
  background: hsl(var(--primary));
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Grid Layout for Individual Pages */
.events-grid,
.incubators-grid,
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
  justify-content: start;
  max-width: fit-content;
}

/* Pagination */
.pagination {
  justify-content: center;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
}

.page-link {
  display: flex;
  justify-content: center;
  min-width: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  cursor: pointer;
}

.page-link:hover:not(.disabled):not(.ellipsis) {
  border-color: hsl(var(--accent));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-link.active {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: hsl(var(--muted));
  border-color: hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

.page-link.ellipsis {
  cursor: default;
  background-color: transparent;
  border-color: transparent;
  color: hsl(var(--muted-foreground));
  min-width: 2rem;
  font-weight: 600;
}

.page-link.ellipsis:hover {
  background-color: transparent;
  transform: none;
  box-shadow: none;
}

/* Previous/Next button styling */
.page-link.prev-btn i,
.page-link.next-btn i {
  font-size: 0.75rem;
}

/* Loading Indicator - Overlay Style */
.loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-lg);
  color: rgba(255, 255, 255, 0.9);
}

/* Full-area overlay for wrapper containers */
.events-content-wrapper .loading-indicator,
.incubators-content-wrapper .loading-indicator,
.reports-content-wrapper .loading-indicator,
#event-wrapper .loading-indicator,
#incubator-wrapper .loading-indicator,
#report-wrapper .loading-indicator {
  border-radius: 0; /* Remove border-radius for full coverage */
}

/* Section Loading Container - Keep for template but hide */
.section-loading-container {
  display: none; /* Hidden by default */
}

/* Make parent containers relative for absolute positioning */
.resource-section {
  position: relative;
}

/* Events content wrapper for full-area loading overlay */
.events-content-wrapper,
.incubators-content-wrapper,
.reports-content-wrapper {
  position: relative;
  min-height: 400px; /* Ensure minimum height for full overlay coverage */
}

.events-grid,
.incubators-grid,
.reports-grid {
  position: relative;
  min-height: 200px; /* Ensure minimum height for overlay */
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid hsl(var(--border));
  border-top: 3px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.error-icon {
  font-size: 4rem;
  color: hsl(var(--destructive));
  margin-bottom: 1rem;
}

.error-title {
  color: hsl(var(--foreground));
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.error-message {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Image fallback styling */
.feed_image {
  background-color: hsl(var(--muted) / 0.3);
  background-image: 
    linear-gradient(135deg, hsl(var(--muted) / 0.2) 0%, hsl(var(--muted) / 0.4) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 4rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
}

.feed_image::before {
  content: "Image Not Available";
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--background) / 0.9);
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  border: 1px solid hsl(var(--border));
}

.feed_image[src*="LogoMain.png"] {
  background-color: hsl(var(--background));
  background-image: none;
  opacity: 0.7;
  object-fit: contain;
  padding: 1rem;
  filter: grayscale(0.3) brightness(1.1);
}

.feed_image[src*="LogoMain.png"]::before {
  content: "Default Logo";
  font-size: 0.7rem;
  bottom: 0.25rem;
}

/* Detail image fallback styling */
.detail_image {
  background-color: hsl(var(--muted) / 0.3);
  background-image: 
    linear-gradient(135deg, hsl(var(--muted) / 0.2) 0%, hsl(var(--muted) / 0.4) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 6rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.detail_image::before {
  content: "Image Not Available";
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--background) / 0.9);
  color: hsl(var(--muted-foreground));
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  border: 1px solid hsl(var(--border));
}

.detail_image[src*="LogoMain.png"] {
  background-color: hsl(var(--background));
  background-image: none;
  opacity: 0.7;
  object-fit: contain;
  padding: 2rem;
  filter: grayscale(0.3) brightness(1.1);
}

.detail_image[src*="LogoMain.png"]::before {
  content: "Default Logo";
  font-size: 0.8rem;
  bottom: 0.75rem;
}

@media (max-width: 768px) {
  .city-filter {
    padding: 0.5rem 0;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }
  
  .city-filter::-webkit-scrollbar {
      display: none;
  }
  
  .city-btn {
    flex: 1;
  }

  .page-link,
  .btn,
  .bi-bookmark {
      display: flex;
      align-items: center;
      justify-content: center;
  }
  .city-btn:focus,
  .page-link:focus,
  .btn:focus {
      outline: 2px solid hsl(var(--primary));
      outline-offset: 2px;
  }
  .resource-scroll-container {
    width: calc(3 * 280px + 2 * 1.5rem); /* Only 3 full cards + gaps for mobile */
  }
  
  .resource-card {
    flex: 0 0 325px;
    min-width: 280px;
    min-height: 500px;
  }
  
  .show-all-content {
    padding: 1.5rem 1rem;
  }

  .events-grid,
  .incubators-grid,
  .reports-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .pagination {
    gap: 0.125rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .section-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .event-card,
  .incubator-card,
  .report-card {
    padding: 1rem;
  }
  
  .card-title {
    margin-bottom: 0.5rem;
  }

  .card-tags {
    gap: 0.25rem;
  }
  
  .tag {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
  
  .page-link {
    min-width: 2rem;
    font-size: 0.75rem;
  }
  
  .page-link.prev-btn,
  .page-link.next-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .page-link.prev-btn i,
  .page-link.next-btn i {
    font-size: 0.625rem;
  }
  
  .page-link.ellipsis {
    min-width: 1.5rem;
  }
  .resourcehub-section-title {
    max-width: 10ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    display: inline-block;
  }
  
  .resourcehub-section-title::before {
      content: attr(title);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  
  /* Show tooltip for all titles that are longer than 9 characters */
  .resourcehub-section-title[title]:hover::after {
      display: block;
  }
  
  .resourcehub-section-title .saved-count {
      font-size: 0.75rem;
      font-weight: 400;
      color: hsl(var(--muted-foreground));
      white-space: nowrap;
  }
  
  /* Mobile section header layout - all in one row */
  .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0.5rem;
      width: 100%;
  }
  
  .resourcehub-section-title {
      display: flex;
  }
  
   /* Hide "Saved Events" text in mobile mode, show only count */
   .saved-count {
       display: flex;
       align-items: center;
       gap: 0.375rem;
   }
   
   .saved-count i {
       display: inline;
       font-size: 0.8rem;
       color: hsl(var(--primary));
   }
   
   .saved-count .count-badge {
       display: inline;
       margin-left:-0.25rem;
   }
   
   /* Hide the text content but keep the icon and count */
   .saved-count,
   .saved-count:not(.count-badge) {
       font-size: 0;
   }
    
  .resourcehub-section-title .saved-count {
      font-size: 0.75rem;
      font-weight: 400;
      color: hsl(var(--muted-foreground));
      white-space: nowrap;
  }
  
  /* Hide "Saved Events" text, show only count */
  .saved-count {
      font-size: 0.75rem;
      font-weight: 400;
      color: hsl(var(--muted-foreground));
      white-space: nowrap;
      background: hsl(var(--muted));
    }
  
  .saved-count::before {
      content: "[";
  }
  
  .saved-count::after {
      content: "]";
  }
  
  .view-all-link {
      font-size: 0.75rem;
      padding:0.25rem 0.5rem;
      margin-right: 0.5rem;
  }
  
  /* Mobile Resource Layout - Horizontal scroll, full width cards */
  .resource-scroll-wrapper {
      padding: 0 !important;
      margin: 0 !important;
  }
  
  .resource-scroll-container {
      margin: 0 !important;
  }
  
  .resource-grid {
      gap: 0.5rem !important;
      padding: 0 0.5rem !important;
  }
  
  .resource-card {
      flex: 0 0 calc(100vw / 1.2);
      min-width: calc(100vw / 1.2);
      max-width: calc(100vw / 1.2);
      min-height: 400px;
  }
  
  /* Hide description and "View All" card in mobile */
  .resource-card .card-description,
  .resource-card.show-all-card,
  .scroll-arrow,
  .resource-scroll-container::-webkit-scrollbar {
      display: none;
  }
  .resource-scroll-container {
      -ms-overflow-style: none;
      scrollbar-width: none;
  }
  
  .resource-section:last-child {
      margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  /* Hide ellipsis on very small screens for cleaner look */
  .page-link.ellipsis {
    display: none;
  }
  
  /* Mobile placeholder image adjustments */
  .feed_image {
    min-height: 120px;
    background-size: 3rem;
  }
  
  .feed_image::before {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    bottom: 0.25rem;
  }
  
  .detail_image {
    min-height: 150px;
    background-size: 4rem;
  }
  
  .detail_image::before {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    bottom: 0.75rem;
  }
}