/*
 * TheCoolSymbols - Main Content CSS
 * Styling for the main content sections
 * Created: June 11, 2025
 */

/* Main content areas */
main {
  flex: 1;
  padding: 2rem 0;
}

.main-section {
  margin-bottom: 3rem;
  animation: fadeIn 0.6s ease-out;
}

.main-content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.main-content-left {
  flex: 1;
  max-width: 700px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
  line-height: 1.2;
}

.section-title span {
  color: var(--primary-color);
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Symbol Board Toggle Button */
.symbol-board-toggle-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.symbol-board-toggle-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(106, 75, 255, 0.3);
  white-space: nowrap;
}

.symbol-board-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(106, 75, 255, 0.4);
}

.symbol-board-toggle-btn:active {
  transform: translateY(0);
}

.symbol-board-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent-color), #d81b60);
}

.symbol-board-toggle-btn.active:hover {
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

/* Featured categories section */
.featured-categories {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 3rem;
}

.featured-categories h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.category-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 1.5rem !important;
  margin: 2rem 0 !important;
  list-style: none !important;
  padding: 0 !important;
}

.featured-categories p {
  color: #252525;
  font-size: 0.95rem;
}

.category-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%) !important;
  border: 1px solid rgba(106, 75, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  list-style: none !important;
}

.category-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6a4bff, #a855f7);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(106, 75, 255, 0.15);
  border-color: rgba(106, 75, 255, 0.2);
}

.category-item:hover::before {
  opacity: 1;
}

.category-symbol {
  font-size: 2.5rem !important;
  line-height: 1 !important;
  margin-bottom: 1rem !important;
  display: block !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)) !important;
}

.category-title {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: white !important;
  text-decoration: none !important;
  line-height: 1.3 !important;
  margin-bottom: 0.5rem !important;
  display: inline-block !important;
  padding: 0.5rem 1rem !important;
  background: linear-gradient(135deg, #6a4bff, #a855f7) !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(106, 75, 255, 0.3) !important;
}

.category-title:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 75, 255, 0.4);
  background: linear-gradient(135deg, #5a3bef, #9333ea);
}

.category-desc {
  font-size: 0.9rem !important;
  color: #718096 !important;
  margin: 0 !important;
  line-height: 1.4 !important;
  font-weight: 500 !important;
}

.category-desc {
  color: #555;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.categories-section {
  margin: 3rem auto;
}

.categories-section .section-title {
  font-size: 2.5rem;
  color: #6f42c1;
  margin-bottom: 2rem;
}

/* Symbol boards container - Masonry layout using CSS columns */
#symbolBoardsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 2rem;
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
}

/* Non-card elements in the container should span full width */
#symbolBoardsContainer .loading-indicator,
#symbolBoardsContainer .end-of-content-message,
#symbolBoardsContainer .error-message {
  grid-column: 1 / -1; /* Span all columns */
  display: block;
  text-align: center;
  margin: 2rem 0;
}

/* Special handling for load more button container */
#symbolBoardsContainer .load-more-button-container {
  grid-column: 1 / -1; /* Span all columns */
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  margin: 2rem auto;
  width: 100%;
}

.symbol-category {
  background-color: #ffffff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
  animation-delay: calc(0.1s * var(--animation-order, 0));
  display: inline-block;
  width: 100%;
  margin-bottom: 2rem;
  break-inside: avoid; /* Prevents breaking cards across columns */
  page-break-inside: avoid; /* For older browsers */
  box-sizing: border-box; /* Ensure padding is included in width calculation */
}

.symbol-category:hover {
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-5px);
}

.symbol-category-header {
  padding: 1.2rem;
  background: #8a6dff;
  color: white;
  flex-shrink: 0; /* Prevents header from shrinking */
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  box-sizing: border-box; /* Ensure padding is included in the width calculation */
}

/* Color variations for category headers */
.symbol-category[data-category="sun"] .symbol-category-header {
  background: #9a6dff;
}

.symbol-category[data-category="emoticons"] .symbol-category-header,
.symbol-category[data-category="kaomoji"] .symbol-category-header {
  background: #8a6dff;
}

.symbol-category[data-category="hand-symbols"] .symbol-category-header {
  background: #7f84fb;
}

.symbol-category[data-category="chess"] .symbol-category-header {
  background: #8a6dff;
}

.symbol-category[data-category="star"] .symbol-category-header,
.symbol-category[data-category="stars"] .symbol-category-header {
  background: #7f84fb;
}

.symbol-category[data-category="animals"] .symbol-category-header {
  background: #8a6dff;
}

.symbol-category[data-category="hearts"] .symbol-category-header {
  background: #f76d98;
}

.symbol-category[data-category="fortnite"] .symbol-category-header {
  background: #5294e2;
}

.symbol-category[data-category="pubg"] .symbol-category-header {
  background: #6a8d3e;
}

.symbol-category[data-category="freefire"] .symbol-category-header {
  background: #ff7f00;
}

.symbol-category[data-category="among-us"] .symbol-category-header {
  background: #e23b4a;
}

.symbol-category-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.symbol-category-title i {
  font-size: 1rem;
}

.symbol-category-description {
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Symbol Grid for emoji and standard symbols - 4x4 grid (16 symbols) */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0; /* Remove gap to eliminate grey spacing */
  background-color: #ffffff; /* Change background to white */
  align-content: start;
  padding: 0; /* Remove padding to eliminate border spacing */
  border-top: 1px solid #f0f0f0; /* Add top border to the grid */
  border-left: 1px solid #f0f0f0; /* Add left border to the grid */
}

/* Emoticon Grid - 3 columns layout */
.symbol-category[data-category="emoticons"] .symbol-grid,
.symbol-category[data-category="kaomoji"] .symbol-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, auto);
}

/* Text art and Emoticon items get more height */
.symbol-category[data-category="emoticons"] .symbol-item,
.symbol-category[data-category="kaomoji"] .symbol-item {
  min-height: 70px;
  aspect-ratio: auto;
  padding: 0.5rem;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

/* Text Art Grid for text art - 3x4 grid (12 symbols) */
.text-art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 0; /* Remove gap to eliminate grey spacing */
  background-color: #ffffff; /* Change background to white */
  align-content: start;
}

/* Common symbol item styles */
.symbol-item {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background-color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  min-height: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px;
}

/* Remove right border from last column items */
.symbol-grid > .symbol-item:nth-child(4n) {
  border-right: none;
}

/* Remove bottom border from last row items */
.symbol-grid > .symbol-item:nth-last-child(-n+4) {
  border-bottom: none;
}

/* Adjustments for 3-column layouts */
.symbol-category[data-category="emoticons"] .symbol-grid > .symbol-item:nth-child(3n),
.symbol-category[data-category="kaomoji"] .symbol-grid > .symbol-item:nth-child(3n) {
  border-right: none;
}

.symbol-category[data-category="emoticons"] .symbol-grid > .symbol-item:nth-last-child(-n+3),
.symbol-category[data-category="kaomoji"] .symbol-grid > .symbol-item:nth-last-child(-n+3) {
  border-bottom: none;
}

/* Text divider symbols need more width - span across multiple columns */
.symbol-category[data-category="text-divider"] .symbol-grid {
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(45px, auto);
}

.symbol-category[data-category="text-divider"] .symbol-item {
  aspect-ratio: auto;
  width: 100%;
  font-size: 1.2rem;
  padding: 0.75rem 0.5rem;
  border-right: none;
  border-bottom: 1px solid #f0f0f0; /* Only bottom border for full-width items */
}

/* Among Us page styles */
.symbols-text-styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: #f5f5f5;
  width: 100%;
}

.text-style {
  background-color: #ffffff;
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-style:hover {
  background-color: #f0f0f0;
}

/* Loading indicator */
.loading-indicator {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(107, 75, 255, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spinner 1s linear infinite;
}

/* Fallback content for noscript */
.fallback-content {
  padding: 2rem;
  background-color: var(--section-alt-bg);
  border-radius: var(--border-radius);
  margin: 2rem 0;
}

.fallback-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.fallback-category {
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  overflow: hidden; /* Ensures the child elements don't overflow */
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

.fallback-category:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-hover);
}

.fallback-category h3 {
  margin: 0;
  padding: 1.2rem;
  color: white;
  background: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Different background colors for different categories */
.fallback-category:nth-child(3n+1) h3 {
  background: #8a6dff;
}

.fallback-category:nth-child(3n+2) h3 {
  background: #7f84fb;
}

.fallback-category:nth-child(3n+3) h3 {
  background: #e23b4a;
}

.fallback-symbols {
  font-size: 1.2rem;
  padding: 1rem;
  line-height: 1.8;
  flex: 1;
  background-color: white;
}

/* Centered "View all" links with proper spacing */
.fallback-category a {
  display: block;
  text-align: center;
  margin-top: 0; /* Remove top margin since we're using padding instead */
  padding: 1rem;
  background-color: var(--card-hover);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.fallback-category a:hover {
  background-color: var(--primary-light);
  color: white;
}

.fallback-message {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Related links and categories section styles */
.related-links-section,
.categories-section {
  margin: 4rem auto;
  max-width: 1200px;
  padding: 0 1rem;
}

.related-links-section .section-title,
.categories-section .section-title {
  font-size: 2.8rem;
  background: linear-gradient(135deg, #6a4bff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Removed container styling as we're not using containers anymore */

/* Responsive adjustments for categories and related links */
@media (max-width: 968px) {
  .category-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .categories-section .section-title,
  .related-links-section .section-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
  }
  
  .category-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .category-item {
    padding: 1.25rem;
  }
  
  .category-title {
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
  }
  
  .category-symbol {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
  }
  
  .category-desc {
    font-size: 0.85rem;
  }
  
  /* Ensure emoticon and kaomoji items maintain proper height on mobile */
  .symbol-category[data-category="emoticons"] .symbol-item,
  .symbol-category[data-category="kaomoji"] .symbol-item {
    min-height: 60px;
    padding: 4px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  /* Keep text divider symbols properly sized on mobile */
  .symbol-category[data-category="text-divider"] .symbol-item {
    min-height: 40px;
    padding: 4px 8px;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
  }
  
  /* Last item in each row shouldn't have a right border */
  .symbol-category[data-category="emoticons"] .symbol-grid > .symbol-item:nth-child(3n),
  .symbol-category[data-category="kaomoji"] .symbol-grid > .symbol-item:nth-child(3n) {
    border-right: none;
  }
  
  /* Last row items shouldn't have bottom borders */
  .symbol-category[data-category="emoticons"] .symbol-grid > .symbol-item:nth-last-child(-n+3),
  .symbol-category[data-category="kaomoji"] .symbol-grid > .symbol-item:nth-last-child(-n+3) {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .categories-section .section-title,
  .related-links-section .section-title {
    font-size: 1.8rem;
  }
  
  .category-item {
    padding: 1rem;
  }
  
  .category-symbol {
    font-size: 2rem;
  }
}

/* Extra small devices (phones) */
@media (max-width: 375px) {
  .symbol-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on very small screens */
    padding: 0;
    gap: 0;
  }
  
  .symbol-item {
    font-size: 1.3rem;
    min-height: 42px;
    padding: 3px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .symbol-category[data-category="emoticons"] .symbol-grid,
  .symbol-category[data-category="kaomoji"] .symbol-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for text-based symbols */
  }
  
  .symbol-category-header {
    padding: 0.8rem;
  }
  
  .symbol-category-title {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  
  .symbol-category-description {
    font-size: 0.8rem;
  }
  
  /* Border adjustments for very small screens */
  /* Override 4-column border styles */
  .symbol-grid > .symbol-item:nth-child(4n) {
    border-right: 1px solid #f0f0f0; /* Reset 4-column right border removal */
  }
  
  /* Apply 3-column border styles */
  .symbol-grid > .symbol-item:nth-child(3n) {
    border-right: none;
  }
  
  /* Reset 4-column bottom border removal */
  .symbol-grid > .symbol-item:nth-last-child(-n+4) {
    border-bottom: 1px solid #f0f0f0;
  }
  
  /* Apply 3-column bottom border removal */
  .symbol-grid > .symbol-item:nth-last-child(-n+3) {
    border-bottom: none;
  }
}

@media (max-width: 968px) {
  .main-content-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .symbol-board-toggle-container {
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
  
  .symbol-board-toggle-btn {
    font-size: 0.95rem;
    padding: 10px 20px;
    margin: 1rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.8rem;
  }
  
  .symbol-grid {
    grid-template-columns: repeat(3, 1fr);
    /* Ensure consistent padding on mobile */
    padding: 2px;
  }
  
  #symbolBoardsContainer {
    grid-template-columns: 1fr;
  }

  /* Adjust symbol item size on very small screens */
  .symbol-item {
    min-height: 45px;
  }
}

/* Load More button styles */
.load-more-button-container {
  /* Base styles - overridden by more specific rule above for masonry layout */
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  width: 100%;
  text-align: center;
}

.load-more-button {
  padding: 15px 30px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(107, 75, 255, 0.2);
}

.load-more-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(107, 75, 255, 0.35);
}

.load-more-button:active {
  transform: translateY(-1px);
}

.load-more-button i {
  font-size: 0.9rem;
}

/* End of content message styles */
.end-of-content-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 2rem;
  margin: 2rem 0;
  background: linear-gradient(135deg, var(--card-color), var(--section-alt-bg));
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.5s ease-out;
}

.end-of-content-message p {
  margin: 0.7rem 0;
  color: var(--text-color);
}

.end-of-content-message p:first-child {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.end-of-content-message p:first-child::before,
.end-of-content-message p:first-child::after {
  content: "✧";
  color: var(--accent-color);
}

/* Loading button state */
.load-more-button.loading {
  pointer-events: none;
  opacity: 0.8;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  position: relative;
  overflow: hidden;
}

.load-more-button.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

.load-more-button.loading i {
  animation: spin 1s linear infinite;
}

/* Responsive design for symbol categories */
@media (max-width: 768px) {
  #symbolBoardsContainer {
    column-count: 1; /* Single column on mobile */
    column-gap: 1.5rem;
    padding: 0.5rem;
  }
  
  .symbol-grid {
    grid-template-columns: repeat(4, 1fr); /* Keep 4 columns for better spacing */
    grid-template-rows: repeat(4, 1fr); /* Maintain 4x4 grid */
    gap: 0;
    padding: 0; /* No padding */
  }
  
  .symbol-item {
    font-size: 1.4rem;
    min-height: 48px;
    padding: 4px; /* Reduced padding for better fit */
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .symbol-category-title {
    font-size: 1.2rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #symbolBoardsContainer {
    column-count: 2; /* Two columns on tablet */
    column-gap: 1.75rem;
  }
}

@media (min-width: 1025px) {
  #symbolBoardsContainer {
    column-count: 3; /* Three columns on desktop */
    column-gap: 2rem;
  }
}

/* Ensure cards work well in masonry layout on large screens */
@media (min-width: 1200px) {
  #symbolBoardsContainer {
    column-count: 3; /* Keep 3 columns even on very large screens */
    column-gap: 2.5rem;
  }
}

/* Dark mode support for category cards */
[data-theme="dark"] .category-item {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-color: rgba(106, 75, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .category-item:hover {
  box-shadow: 0 8px 25px rgba(106, 75, 255, 0.3);
  border-color: rgba(106, 75, 255, 0.5);
}

[data-theme="dark"] .category-desc {
  color: #a0aec0;
}

/* Animation for category items */
@keyframes categoryFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-item {
  animation: categoryFadeIn 0.6s ease-out forwards;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.2s; }
.category-item:nth-child(3) { animation-delay: 0.3s; }
.category-item:nth-child(4) { animation-delay: 0.4s; }
.category-item:nth-child(5) { animation-delay: 0.5s; }
.category-item:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced button effects */
.category-title {
  position: relative;
  overflow: hidden;
}

.category-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.category-title:hover::before {
  left: 100%;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* High specificity overrides for category cards */
.categories-section .category-list,
.related-links-section .category-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 1.5rem !important;
  margin: 2rem 0 !important;
  list-style: none !important;
  padding: 0 !important;
}

.categories-section .category-item,
.related-links-section .category-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%) !important;
  border: 1px solid rgba(106, 75, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  list-style: none !important;
}

.categories-section .category-item::before,
.related-links-section .category-item::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: linear-gradient(90deg, #6a4bff, #a855f7) !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.categories-section .category-item:hover,
.related-links-section .category-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 25px rgba(106, 75, 255, 0.15) !important;
  border-color: rgba(106, 75, 255, 0.2) !important;
}

.categories-section .category-item:hover::before,
.related-links-section .category-item:hover::before {
  opacity: 1 !important;
}

/* Mobile touch improvements for symbol items */
@media (pointer: coarse) {
  .symbol-item {
    min-height: 55px; /* Larger touch targets on touch devices */
    max-height: 65px;
    font-size: 1.7rem; /* Slightly larger on touch devices */
  }
  
  .symbol-item:active {
    background-color: var(--primary-color);
    color: white;
    transform: scale(0.95);
  }
}

/* Better mobile responsiveness for very small screens */
@media (max-width: 400px) {
  .symbol-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .symbol-item {
    font-size: 1.5rem;
    min-height: 48px;
    max-height: 58px;
  }
}

/* Adaptive grid for categories with longer symbols (text dividers, emoticons, etc.) */
.symbol-grid.adaptive {
  grid-template-columns: repeat(2, 1fr); /* Fewer columns for wider symbols */
  grid-template-rows: repeat(6, 1fr); /* More rows to accommodate same number of symbols */
}

.symbol-grid.adaptive .symbol-item {
  aspect-ratio: 3/1; /* Wider aspect ratio for longer symbols */
  font-size: 1.2rem; /* Smaller font size to fit longer text */
  min-height: 45px;
  max-height: 45px;
  padding: 0 8px; /* Add horizontal padding */
  white-space: nowrap; /* Prevent wrapping */
  overflow: hidden; /* Hide overflow */
  text-overflow: ellipsis; /* Show ellipsis for very long symbols */
}

/* Adaptive grid for special cases */
.symbol-grid.adaptive,
.text-art-grid.adaptive {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

/* Make text dividers span multiple columns for better display */
.symbol-item.divider {
  grid-column: 1 / -1; /* Span all columns */
  text-align: center;
  font-size: 1.1rem;
  padding: 5px;
  height: 40px;
  min-height: 40px;
  white-space: normal;
  word-break: break-all;
}

/* Text art symbols need more space */
.symbol-item.kaomoji,
.symbol-item.text-art {
  font-size: 1.2rem;
  white-space: nowrap;
  padding: 0 0.5rem;
}

/* Among Us-specific styling */
.symbol-category[data-category="among-us"] .symbol-item {
  font-size: 1.7rem;
}

/* Symbol category footer styling for "View all" links */
.symbol-category-footer {
  padding: 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  background-color: var(--card-hover);
  margin-top: auto;
}

.view-all-link {
  display: block;
  padding: 0.8rem 1rem;
  font-weight: 500;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.view-all-link:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

.view-all-link i {
  margin-left: 0.5rem;
  transition: var(--transition);
}

.view-all-link:hover i {
  transform: translateX(3px);
}

/* Fix view-all alignment and background */
#symbolBoardsContainer .view-all-link,
.fallback-category a {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive grid for symbol containers */
#symbolBoardsContainer,
.fallback-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-gap: 1.5rem;
}

@media screen and (max-width: 767px) {
  #symbolBoardsContainer,
  .fallback-categories {
    display: flex;
    flex-direction: column;
  }
}
