/* ===== RESET AND BASE STYLES ===== */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Ubuntu", Arial, sans-serif;
  line-height: 1.6;
  color: #333333;
  background: #ffffff;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:lang(zh) {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
}

body:lang(jp) {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

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

a {
  text-decoration: none;
  color: inherit;
}

/* ===== UTILITY CLASSES ===== */
.container,
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER STYLES ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 0;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: rgba(0, 0, 0, 0.1) 1px 1px 10px 0px;
  transition: all 0.5s ease-in-out;

  &.dark {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: none;

    .brand-tagline {
      color: #ccc;
    }

    .nav-item-title {
      color: #ffffff;
    }

    .search-icon {
      filter: invert(1);
    }

    .menu-line {
      background: #ffffff;
    }

    .nav-dropdown-list {
      background: #1a212b;
      background-image: linear-gradient(180deg,
          rgba(26, 33, 43, 1) 0%,
          rgba(26, 33, 43, 0.89) 50%,
          rgba(26, 33, 43, 0.57) 100%);
      border-top: 1px solid #2a3541;
      border-bottom: 1px solid #2a3541;
    }

    .nav-dropdown-link:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .nav-dropdown-link p {
      color: #bdc3c7;
    }

    .lang-dropdown {
      .nav-item-title {
        color: #ffffff;
      }

      .nav-dropdown-icon {
        border-color: #ffffff;
      }

      .nav-dropdown-list {
        background: #1a1a1a;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
      }

      .nav-dropdown-link:hover {
        background-color: #333333;
      }

      .nav-dropdown-link p {
        color: #ffffff;
      }
    }
  }
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand Section */
.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;

  .brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;

    &:hover {
      opacity: 0.8;
    }

    .brand-logo {
      height: 35px;
      width: auto;
      display: block;
    }
  }

  .brand-tagline {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-left: 0;
    white-space: nowrap;
    text-decoration: none;
  }
}

/* Navigation Menu */
.nav-menu-wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-menu {
  padding-top: 20px;
  display: flex;

  .nav-menu-shadow-overlay {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

/* Mobile Menu Elements */
.tablet-menu {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 0;
  width: 100%;
}

.logo-mobile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.3s ease;
}

.logo-mobile:hover {
  opacity: 0.8;
}

.logo-mobile img {
  height: 40px;
  width: auto;
}

.logo-mobile .logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.close-menu-button {
  display: none;
  cursor: pointer;
  padding: 8px;
  color: #ffffff;
  transition: opacity 0.3s ease;
}

.close-menu-button:hover {
  opacity: 0.7;
}

.close-menu-button svg {
  width: 36px;
  height: 36px;
}

.menu-button {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;

  .menu-line {
    width: 24px;
    height: 2px;
    background: #333333;
    transition: all 0.3s ease;
  }
}

.site-header.dark .menu-button .menu-line {
  background: #ffffff;
}

/* Mobile Menu Items */
.mobile-menu-items {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  width: 100%;
}

.mobile-menu-link {
  display: block;
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  width: 100%;
}

.mobile-menu-link:last-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-divider {
  display: none;
}

/* Navigation Dropdowns */
.nav-dropdown {
  position: relative;

  &:hover {
    .nav-dropdown-icon {
      transform: rotate(225deg);
    }

    .nav-dropdown-list {
      opacity: 1;
      visibility: visible;
      transform: translateX(-50%) translateY(10px);
    }
  }

  .nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: none;
    text-decoration: none;

    &:hover {
      opacity: 0.8;
    }
  }

  .nav-item-title {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    margin: 0;
    transition: color 0.3s ease;
    min-width: 55px;
  }

  .nav-dropdown-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }

  .nav-dropdown-list {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
  }

  .nav-dropdown-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-dropdown-link {
    padding: 1rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;

    &:hover {
      background: #f8f9fa;
    }

    p {
      font-size: 14px;
      color: #666666;
      margin: 0;
      line-height: 1.4;
    }
  }
}

/* Right Elements */
.nav-right-elements {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
  margin: 0px 10px 0px 0px;

  &.active {
    .nav-dropdown-icon {
      transform: rotate(-135deg);
    }

    .nav-dropdown-list {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
  }

  .nav-dropdown-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .nav-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    padding: 0px;
    border-bottom: none;
    transition: color 0.3s ease;
    width: 45px;
    height: 25.5px;
    display: flex;
    align-items: center;
  }

  .nav-dropdown-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid #333333;
    border-bottom: 2px solid #333333;
    transform: rotate(45deg);
    transition:
      transform 0.3s ease,
      border-color 0.3s ease;
  }

  .nav-dropdown-list {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 120px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
  }

  .nav-dropdown-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;

    &:hover {
      background-color: #f5f5f5;
    }

    p {
      font-size: 14px;
      font-weight: 500;
      color: #333333;
      margin: 0;
    }
  }
}

/* Blog Button */
.nav-blog {
  color: #1a1a1a;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0px;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header.dark .nav-blog {
  color: #ffffff;
}

.nav-blog:hover {
  opacity: 0.9;
}

/* Contact Button */
.nav-contact {
  background: #ff0037;
  color: #ffffff;
  padding: 15px 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0px;
  transition: all 0.3s ease;
  box-shadow: rgba(247, 64, 112, 0.3) 0px 6px 10px 0px;
  border: none;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  width: 146.43px;
  height: 43.98px;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: #e6003d;
    box-shadow: rgba(247, 64, 112, 0.4) 0px 8px 12px 0px;
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0);
    box-shadow: rgba(247, 64, 112, 0.3) 0px 6px 10px 0px;
  }
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
  padding-top: 80px;
  flex: 1;
}

/* ===== FOOTER STYLES ===== */
.site-footer {
  background: #1a1a1a;
  color: #ffffff;
  padding: 4rem 0 2rem 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  margin-bottom: 2rem;
  align-items: start;
}

.footer-logo-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;

  .footer-logo {
    height: 180px;
    width: auto;
    margin-bottom: 1rem;
  }

  .footer-tagline {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
  }
}

.footer-about-section {
  h3 {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
  }

  p {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;

    strong {
      font-weight: 700;
    }

    a {
      color: #ffffff;
      text-decoration: underline;
      transition: color 0.3s ease;

      &:hover {
        color: #ff0037;
      }
    }
  }
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 1rem 0;
  border-top: 1px solid #333333;
}

.footer-links a {
  color: #999;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #333333;
  padding-top: 2rem;
  text-align: center;
  color: #cccccc;
}

/* ===== MEDIA QUERIES ===== */

/* Large screens and down */
@media (min-width: 1024px) {
  .nav-menu-wrapper {
    justify-content: flex-end;
  }
}

/* Tablet and smaller desktop */
@media (max-width: 1024px) {
  .nav-menu-shadow-overlay {
    gap: 1rem;
  }
}

/* Mobile and tablet */
@media (max-width: 768px) {
  .site-header {
    z-index: 1000;
    box-shadow: none;
    padding: 15px 0;
  }

  .site-header.dark {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 15px 0;
  }

  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 10px 15px;
  }

  .brand-section {
    gap: 12px;
    flex: 1;

    .brand-tagline {
      font-size: 12px;
    }
  }

  .nav-menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .nav-menu-wrapper.active {
    pointer-events: auto;
    opacity: 1;
  }

  /* Background overlay */
  .nav-menu-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
  }

  .nav-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 330px;
    max-width: 50%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .nav-menu-wrapper.active .nav-menu {
    transform: translateX(0);
  }

  .nav-menu-shadow-overlay {
    flex-direction: column;
    gap: 0;
    padding: 0;
    width: 100%;
  }

  .tablet-menu {
    display: flex;
  }

  .close-menu-button {
    display: block;
  }

  .mobile-menu-items {
    display: flex;
  }

  .mobile-menu-items .lang-dropdown {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
  }

  .mobile-menu-items .lang-dropdown .nav-dropdown-toggle {
    padding: 0;
    color: #ffffff;
    font-size: 18px;
  }

  .mobile-menu-items .lang-dropdown .nav-item-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
  }

  .nav-right-elements {
    display: none;
  }

  .menu-button {
    display: flex;
  }

  .nav-menu {
    gap: 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;

    .footer-logo-section {
      order: 1;
    }

    .footer-about-section {
      order: 2;
    }
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .nav-menu {
    width: 100%;
    max-width: 100%;
  }

  .nav-menu-wrapper::before {
    display: none;
  }

  .content-wrapper {
    padding: 0 15px;
  }
}