/* ===== style.css - 沙巴体育 (Sabasports) ===== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #ffffff;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: #111827;
  color: #e5e7eb;
}

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: #1a2a3a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo a {
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-menu a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-menu a:hover {
  border-bottom-color: #fbbf24;
  color: #fff;
}

.dark-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.dark-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Mobile Header ---------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    background: #1a2a3a;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    padding: 16px 24px;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    border-bottom: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1a2a3a 0%, #2d4a62 100%);
  color: #fff;
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(251, 191, 36, 0.05) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(10%, 10%);
  }
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 16px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 32px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.hero .btn {
  background: #fbbf24;
  color: #1a2a3a;
  padding: 14px 36px;
  border-radius: 40px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.3);
}

.hero .btn:hover {
  background: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

/* ---------- Section Common ---------- */
section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: #fbbf24;
  margin: 12px auto 0;
  border-radius: 2px;
}

.section-sub {
  text-align: center;
  color: #6b7280;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

body.dark .section-sub {
  color: #9ca3af;
}

/* ---------- Grids ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Card ---------- */
.card {
  background: rgba(249, 250, 251, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark .card {
  background: rgba(31, 41, 55, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.card p {
  color: #4b5563;
  font-size: 0.95rem;
}

body.dark .card p {
  color: #d1d5db;
}

.card .tag {
  display: inline-block;
  background: #e5e7eb;
  color: #374151;
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

body.dark .card .tag {
  background: #374151;
  color: #d1d5db;
}

/* ---------- About ---------- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 16px;
}

/* ---------- Testimonials ---------- */
.testimonial {
  background: rgba(243, 244, 246, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-left: 4px solid #fbbf24;
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: transform 0.2s;
}

.testimonial:hover {
  transform: translateX(4px);
}

body.dark .testimonial {
  background: rgba(31, 41, 55, 0.7);
}

.testimonial p {
  font-style: italic;
}

.testimonial .author {
  font-weight: 600;
  margin-top: 8px;
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.faq-item:hover {
  background: rgba(251, 191, 36, 0.05);
}

body.dark .faq-item {
  border-color: #374151;
}

body.dark .faq-item:hover {
  background: rgba(251, 191, 36, 0.08);
}

.faq-question {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding-top 0.3s;
  padding-top: 0;
  color: #4b5563;
}

body.dark .faq-answer {
  color: #d1d5db;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding-top: 12px;
}

/* ---------- HowTo ---------- */
.howto-step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 12px;
  transition: background 0.2s;
}

.howto-step:hover {
  background: rgba(251, 191, 36, 0.05);
}

.howto-step .step-num {
  background: #fbbf24;
  color: #1a2a3a;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* ---------- Articles ---------- */
.article-card .meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

body.dark .article-card .meta {
  color: #9ca3af;
}

.article-card a {
  color: #1a2a3a;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.article-card a:hover {
  color: #fbbf24;
}

body.dark .article-card a {
  color: #fbbf24;
}

body.dark .article-card a:hover {
  color: #f59e0b;
}

/* ---------- Contact ---------- */
.contact-info p {
  margin-bottom: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1a2a3a;
  color: rgba(255, 255, 255, 0.8);
  padding: 40px 0 20px;
  font-size: 0.9rem;
}

.site-footer .grid-4 {
  gap: 20px;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 12px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #fbbf24;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 32px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
}

/* ---------- Scroll to Top ---------- */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1a2a3a;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 99;
  transition: all 0.2s;
}

.scroll-top.visible {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.scroll-top:hover {
  background: #fbbf24;
  color: #1a2a3a;
  transform: scale(1.1);
}

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

/* ---------- Banner Carousel ---------- */
.banner-carousel {
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 16px;
  height: 200px;
}

body.dark .banner-carousel {
  background: #1f2937;
}

.banner-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s;
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(26, 42, 58, 0.8) 0%, rgba(45, 74, 98, 0.8) 100%);
  color: #fff;
}

.banner-slide.active {
  opacity: 1;
}

.banner-slide h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* ---------- Stats Animation ---------- */
.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a2a3a;
}

body.dark .stat-number {
  color: #fbbf24;
}

/* ---------- Search Box ---------- */
.search-box {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto 32px;
}

.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 40px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.search-box input:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.search-box button {
  background: #1a2a3a;
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: #fbbf24;
  color: #1a2a3a;
}

body.dark .search-box input {
  background: rgba(31, 41, 55, 0.8);
  border-color: #374151;
  color: #e5e7eb;
}

/* ---------- Misc ---------- */
img {
  max-width: 100%;
  height: auto;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.gap-16 {
  gap: 16px;
}

.flex {
  display: flex;
  flex-wrap: wrap;
}

/* ---------- Section Backgrounds ---------- */
#products,
#advantages,
#insights,
#howto {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

body.dark #products,
body.dark #advantages,
body.dark #insights,
body.dark #howto {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* ---------- Scroll Animation (reveal on scroll) ---------- */
section {
  opacity: 0;
  transform: translateY(30px);
  animation: sectionReveal 0.6s ease forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }
section:nth-child(7) { animation-delay: 0.7s; }
section:nth-child(8) { animation-delay: 0.8s; }
section:nth-child(9) { animation-delay: 0.9s; }
section:nth-child(10) { animation-delay: 1.0s; }

@keyframes sectionReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive Fine-tune ---------- */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .card {
    padding: 20px;
  }

  .banner-carousel {
    height: 160px;
  }

  .banner-slide h3 {
    font-size: 1.2rem;
  }
}

/* ---------- Dark Mode Card Glass Effect Enhancement ---------- */
body.dark .card {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Smooth hover for all interactive elements ---------- */
a,
button,
.card,
.testimonial,
.faq-item,
.howto-step,
.scroll-top {
  transition: all 0.2s ease;
}