.container1 {
  margin: 0;
  padding: 0;
}

.category-section {
  padding: 60px 0;
  background-color: var(--color-accent-3) ;  
  box-shadow: 0 20px 40px var(--shadow-0-1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.category-content {
  position: relative;
  z-index: 2;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 3.6rem;
  color: var(--color-surface);
  margin: 0 3vw 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fixed rgba() syntax - separated color and opacity */
.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--color-surface);
  opacity: 0.9;
  margin-bottom: 20px;
  font-weight: 500;
  margin: 0 15vw 20px;
}

.section-title-mobile {
  display: none;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: white;
  margin: 0 5vw 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-subtitle-mobile {
  display: none;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  font-weight: 500;
  margin-bottom: 20px;
}

.cta-button {
  display: inline-block;
  background-color: #ffc107;
  color: #1a202c;
  font-weight: 600;
  padding: 12px 30px;
  margin-bottom: 30px;
  border-radius: 100px;
  text-decoration: none;
  font-size: clamp(1.1rem, 3vw, 1.2rem);
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

@media (hover: hover) {
  .cta-button:hover {
    background-color: #f6d655;
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  }
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 130px));
  gap: 15px;
  max-width: 1500px;
  justify-content: center;
  margin: 0 auto;
  padding: 0 20px;
}

.category-item {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out both;
  will-change: transform;
}

.category-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.category-item:active {
  transform: translateY(2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

@media (hover: hover) {
  .category-item:hover::before {
    left: 100%;
  }

  .category-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    background: white;
  }

  .category-item:hover .category-icon {
    transform: scale(1.1);
  }

  .category-item:hover .category-text {
    color: #2d3748;
  }
}

.category-icon {
  width: clamp(44px, 5vw, 50px);
  height: clamp(44px, 5vw, 50px);
  transition: all 0.3s ease;
  margin-bottom: 5px;
}

.category-text {
  font-size: clamp(0.7rem, 2.2vw, 0.85rem);
  font-weight: 600;
  text-align: center;
  color: #4a5568;
  transition: color 0.3s ease;
  max-width: 90%;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wave-separator {
  display: block;
  width: 100%;
  height: 80px;
  margin-top: -1px;
  z-index: 1;
  position: relative;
}

.wave-separator svg {
  display: block;
  width: 100%;
  height: 100%;
}

.most-read-section,
.most-visited-section,
.fundamental-section {
  margin-top: -80px;
  position: relative;
  z-index: 0;
}

.most-read-section {
  padding: 60px 0 20px;
  background: var(--color-wave-2);
}

.section-title1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 40px;
  text-align: center;
  position: relative;
}

.section-title1::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, var(--color-accent-2), var(--color-accent-3));
  border-radius: 2px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.article-card {
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  will-change: transform;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.article-card:hover .article-image img {
  transform: scale(1.1);
}

.article-image {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, var(--color-purple-1) 0%, var(--color-purple-2) 100%);
  position: relative;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.article-content {
  padding: 15px;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.article-category {
  display: inline-block;
  background-color: #edf2f7;
  color: #2d3748;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.article-description {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: 0.85rem;
  margin-top: 8px;
  line-height: 1.5;
  max-height: calc(1.5em * 4);
}

.article-anchor {
  color: black;
  text-decoration: none;
}

.most-visited-section {
  padding: 80px 0 40px;
  background: var(--color-wave-3);
  position: relative;
}

.categories-grid1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 45px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.category-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-bg-light-mid);
  padding: 35px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  will-change: transform;
  border-radius: 15px;
}

.category-chart::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--color-accent-2), var(--color-accent-3));
}

.category-chart:active {
  transform: translateY(2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

@media (hover: hover) {
  .category-chart:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #4fd1c7;
  }

  .category-chart:hover .chart-percentage {
    color: #4fd1c7;
    transform: scale(1.05);
  }

  .category-chart:hover .chart-label {
    transform: scale(1.02);
  }

  .category-chart:hover .chart-progress {
    stroke-width: 10;
    filter: drop-shadow(0 0 8px rgba(79, 209, 199, 0.3));
  }
}

.chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 35%;
  margin-bottom: 15px;
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  max-width: 100%;
}

.chart-background {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
  stroke-linecap: round;
}

.chart-progress {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease-in-out;
}

.chart-progress.animated {
  animation: chartAnimation 1.5s ease-out;
}

.chart-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  width: 140px;
  text-align: center;
}

.chart-percentage {
  display: block;
  font-size: 3.2rem;
  font-weight: 800;
  color: #2d3748;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-label {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-accent-2);
  margin-bottom: 10px;
  line-height: 1.3;
  pointer-events: all;
  transition: color 0.3s ease;
  max-width: 120px;
  margin-left: auto;
  margin-right: auto;
}

.chart-label:hover {
  color: #38b2ac;
  text-decoration: underline;
}

.chart-views {
  display: block;
  font-size: 1.05rem;
  color: #4a5568;
  font-weight: 500;
  opacity: 0.8;
  line-height: 1.2;
}

.fundamental-section {
  padding: 60px 0 30px;
  position: relative;
}

.fundamental-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.fundamental-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  justify-content: center;
}

.fundamental-article-card-link {
  display: none;
}

.fundamental-article-card-link.visible {
  text-decoration: none;
  color: inherit;
  display: block;
}

.fundamental-article-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.fundamental-article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: #2d8a7f;
}

.fundamental-img-wrapper {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
}

.fundamental-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.fundamental-article-card:hover .fundamental-img-wrapper img {
  transform: scale(1.05);
}

.fundamental-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fundamental-category-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d8a7f;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fundamental-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

#show-more-btn {
  background: linear-gradient(135deg, var(--color-accent-2), var(--color-accent-3));
  color: var(--color-surface);
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 30px auto 0;
  min-width: 200px;
  box-shadow: 0 4px 15px rgba(79, 209, 199, 0.3);
  position: relative;
  overflow: hidden;
}

#show-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 209, 199, 0.4);
}

#show-more-btn:active {
  transform: translateY(0);
}

#show-more-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

#show-more-btn.loading .btn-text {
  opacity: 0.7;
}

#show-more-btn.loading .btn-icon {
  animation: spin 1s linear infinite;
}

#show-more-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#show-more-btn:active::before {
  width: 300px;
  height: 300px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chartAnimation {
  from {
    stroke-dasharray: 0 283;
  }
}

@media (max-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 120px));
    gap: 12px;
  }

  .articles-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  .categories-grid1 {
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
  }

  .cta-button:active {
    transition: all 0.3s ease;
    opacity: 0.8;
    transform: translateY(-30%) scale(0.9);
  }
}

@media (max-width: 1024px) {
  .category-section {
    padding: 50px 20px;
  }

  .wave-separator {
    margin-top: -1%;
  }

  .most-read-section,
  .most-visited-section,
  .fundamental-section {
    padding: 80px 20px 50px;
  }

  .container,
  .fundamental-container {
    padding: 0 20px;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    max-width: 1500px;
    justify-content: center;
    margin: 0 auto;
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .category-section {
    padding: 40px 10px;
  }

  .section-subtitle {
    display: none;
  }

  .section-title {
    display: none;
  }
  .section-subtitle-mobile {
    display: inline-block;
    margin: 0 5vw 30px;
  }

  .section-title-mobile {
    display: inline-block;
    font-size: 1.9rem;
    margin: 0 20px 30px;
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
  }

  .categories-grid1 {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .fundamental-container {
    padding: 0 15px;
  }

  .fundamental-articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
  }

  .fundamental-img-wrapper {
    height: 140px;
  }

  .fundamental-content {
    padding: 15px;
  }

  .fundamental-title {
    font-size: 1rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .fundamental-category-text {
    font-size: 0.8rem;
  }

  .cta-button {
    padding: 10px 30px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 10px;
  }

  .category-item {
    min-height: 80px;
    padding: 6px;
    min-width: 44px;
  }

  .category-icon {
    width: clamp(36px, 5vw, 50px);
    height: clamp(36px, 5vw, 50px);
  }

  .category-text {
    font-size: 0.7rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article-image {
    height: 150px;
  }

  .article-content {
    padding: 15px;
  }

  .article-title {
    font-size: 1rem;
  }

  .article-description {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    max-height: calc(1.4em * 4);
  }

  .chart-svg {
    width: 220px; /* bumped for better visibility on small screens */
    height: 220px;
    max-width: 100%;
  }

  .chart-text {
    width: 180px; /* larger container for the bigger SVG */
  }

  .chart-percentage {
    font-size: 2.4rem; /* increase number size to match larger chart */
  }

  .chart-label {
    font-size: 1rem;
    max-width: 120px;
  }

  .fundamental-img-wrapper {
    height: 180px;
  }

  .fundamental-title {
    font-size: 1rem;
    line-height: 1.3;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .category-section {
    padding: 20px 15px;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .section-subtitle {
    font-size: 0.85rem;
    margin-bottom: 15px;
  }

  .categories-grid {
    gap: 6px;
  }

  .category-item {
    min-height: 70px;
  }
}

@media (min-width: 1501px) {
  .categories-grid {
    justify-content: space-around;
  }
}

@media print {
  .category-section,
  .most-read-section,
  .most-visited-section,
  .fundamental-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cta-button,
  #backToTop,
  #show-more-btn {
    display: none;
  }

  .article-card,
  .category-chart,
  .fundamental-article-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background-color: #38b2ac;
  color: white;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

#backToTop.hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent-2), var(--color-accent-3));
  z-index: 1000;
  transition: width 0.1s ease;
}

body.dark-theme .section-title,
body.dark-theme .section-subtitle {
  color: var(--color-text);
}

body.dark-theme .cta-button {
  background-color: #ffc107;
  color: #1a202c;
}

@media (hover: hover) {
  body.dark-theme .cta-button:hover {
    background-color: #f6d655;
  }
}

body.dark-theme .category-item {
  background: rgba(28, 31, 36, 0.95);
  color: var(--color-surface);
}

body.dark-theme .categories-grid .category-item:first-of-type .category-icon {
  color: rgb(107, 115, 122) !important;
}

body.dark-theme .category-item:hover {
  background: #1c1f24;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .category-text {
  color: #e2e8f0;
}

body.dark-theme .category-item:hover .category-text {
  color: #f7fafc;
}

body.dark-theme .most-read-section {
  background: #111827;
}

body.dark-theme .wave-separator.wave-2 svg path {
  fill: #111827;
}

body.dark-theme .section-title1 {
  color: #f7fafc;
}

body.dark-theme .article-card {
  background: #1c1f24;
}

body.dark-theme .article-title {
  color: #f7fafc;
}

body.dark-theme .article-card .article-description span {
  color: #f7fafc !important;
  background: transparent !important;
}

body.dark-theme .article-anchor {
  color: #f7fafc !important;
}

body.dark-theme .article-category {
  background-color: #2d3748;
  color: #e2e8f0;
}

body.dark-theme .most-visited-section {
  background: #0f2d2b;
}

body.dark-theme .wave-separator.wave-3 svg path {
  fill: #0f2d2b;
}

body.dark-theme .category-chart {
  background: var(--color-bg-dark-start);
  border: 1px solid var(--color-bg-dark-mid);
}

body.dark-theme .category-chart:hover {
  border-color: #4fd1c7;
}

body.dark-theme .chart-percentage {
  color: #f7fafc;
}

body.dark-theme .chart-views {
  color: #a0aec0;
}

body.dark-theme .category-chart:hover .chart-percentage {
  color: #4fd1c7;
}

body.dark-theme .fundamental-section {
  background: #111827;
}

body.dark-theme .fundamental-article-card {
  background: #1c1f24;
}

body.dark-theme .fundamental-article-card:hover {
  border-color: #2d8a7f;
}

body.dark-theme .fundamental-title {
  color: #f7fafc;
}

body.dark-theme .fundamental-category-text {
  color: #4fd1c7;
}

body.dark-theme #backToTop {
  background-color: #38b2ac;
}

body.dark-theme #show-more-btn {
  background-color: var(--color-accent-3);
  color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
