@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root {
  --primary: #f59e0b;
  /* Safety Orange/Yellow */
  --primary-dark: #d97706;
  --secondary: #1e293b;
  /* Industrial Slate/Steel */
  --secondary-dark: #0f172a;
  --bg-color: #f8fafc;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
}

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

body {
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-color);
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: 'Chakra Petch', 'Noto Sans TC', sans-serif;
  font-weight: 700;
}

a {
  text-decoration: none;
  transition: all 0.3s ease;
}

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

.mt-2 {
  margin-top: 0.5rem;
}

/* Top Bar */
.top-bar {
  background-color: var(--secondary-dark);
  color: #cbd5e1;
  font-size: 0.85rem;
  padding: 8px 0;
}

.top-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info span {
  margin-right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cert-info i {
  color: var(--primary);
}

/* Header */
.header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--secondary-dark);
}

.logo-img-wrap {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
}

.logo-img-wrap img {
  width: auto;
  display: block;
}

.logo-img-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  animation: shine 6s infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

.logo-text h1, .logo-text .logo-title {
  font-size: 1.4rem;
  margin-bottom: 2px;
  font-weight: 700;
  font-family: 'Chakra Petch', 'Noto Sans TC', sans-serif;
}

.logo-text span {
  font-size: 0.7rem;
  font-family: 'Chakra Petch', sans-serif;
  color: var(--text-light);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  color: var(--secondary);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 10px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-dark);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  transition: 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Dropdown Menu CSS */
.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-top: 3px solid var(--primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

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

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.dropdown-menu a::after {
  display: none; /* Remove bottom border animation for dropdown items */
}

.dropdown-menu a:hover {
  background-color: #f1f5f9;
  color: var(--primary-dark);
  padding-left: 25px; /* Slight indent on hover */
}

@media (max-width: 992px) {
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-top: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    background-color: #f8fafc;
    padding: 0;
  }
  
  .nav-item-dropdown.open .dropdown-menu {
    display: flex;
  }
  
  .dropdown-menu a {
    padding: 12px 20px;
    text-align: center;
  }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--secondary-dark);
  cursor: pointer;
}

.btn-quote {
  background: var(--secondary);
  color: var(--white);
  font-weight: 700;
  padding: 12px 24px;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
  letter-spacing: 1px;
}

.btn-quote:hover {
  background: var(--primary);
  color: var(--secondary-dark);
}

/* Hero Section */
.hero {
  background-image: url('../img/home_banner.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--secondary);
  color: var(--white);
  padding: 100px 0 160px;
  position: relative;
  border-bottom: 10px solid var(--primary);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.5) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--secondary-dark);
  font-weight: 700;
  padding: 8px 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.hero-title {
  font-size: 4rem;
  line-height: 1.2;
  margin-bottom: 24px;
  text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5);
}

.highlight {
  color: var(--primary);
}

.hero-desc {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 40px;
  font-weight: 400;
  max-width: 600px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--secondary-dark);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  margin-left: 16px;
}

.btn-outline:hover {
  background: var(--white);
  color: var(--secondary-dark);
}

/* Hero Stats spacing */
.hero-stats {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

.stat-box {
  flex: 1;
  background: var(--white);
  padding: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-bottom: 4px solid var(--secondary);
  text-align: center;
}

.stat-num {
  font-size: 3rem;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  color: var(--secondary-dark);
  line-height: 1;
}

.stat-num span {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-left: 4px;
}

.stat-text {
  margin-top: 10px;
  font-weight: 600;
  color: var(--text-light);
}

.brand-promise {
  background: var(--primary);
  border-bottom-color: var(--secondary-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-promise .stat-text {
  color: var(--secondary-dark);
  font-size: 1.8rem;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  margin-top: 0;
}

.brand-promise .stat-sub {
  color: var(--secondary-dark);
  font-weight: 600;
  opacity: 0.8;
}

/* Services */
.services {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--secondary-dark);
}

.divider {
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 20px auto;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
}

.service-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.service-item {
  display: flex;
  gap: 24px;
  padding: 30px;
  background: var(--white);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.service-item:hover {
  box-shadow: -8px 8px 0 var(--secondary-dark);
  transform: translate(4px, -4px);
  border-color: var(--secondary-dark);
}

.service-icon {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--secondary-dark);
  clip-path: polygon(20% 0%, 100% 0, 100% 80%, 80% 100%, 0 100%, 0% 20%);
}

.service-item:hover .service-icon {
  background: var(--primary);
}

.service-content h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--secondary-dark);
}

.service-content p {
  color: var(--text-light);
}

/* Footer */
.footer {
  background: var(--secondary-dark);
  color: #cbd5e1;
  padding: 80px 0 20px;
  border-top: 4px solid var(--primary);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 40px;
}

.footer-info .logo-img-wrap {
  margin-bottom: 16px;
}

.footer-info h3 {
  color: var(--white);
  font-size: 1.5rem;
}

.footer-contact h4 {
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.footer-contact h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary);
}

.contact-list {
  list-style: none;
}

.contact-list li {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.contact-list i {
  color: var(--primary);
  margin-top: 4px;
}

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

@media (max-width: 992px) {
  .service-layout {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    margin-top: 40px;
  }

  .stat-box {
    min-width: calc(50% - 10px);
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn {
    display: block;
  }

  .btn-quote {
    display: none;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 90px;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 15px 20px;
    text-align: center;
  }

  .nav-links a::after {
    display: none; /* 隱藏行動版的底線動畫，改用背景色 */
  }

  .nav-links a.active {
    background-color: #fffbeb;
  }

  .nav-links.active {
    display: flex;
  }
}

@media (max-width: 768px) {
  .top-bar {
    display: none;
  }

  .logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .logo-text h1, .logo-text .logo-title {
    line-height: 1.2;
  }

  .logo-text span {
    display: block;
    line-height: 1.2;
    margin-top: 2px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .stat-box {
    min-width: 100%;
  }
}

@media (max-width: 400px) {
  .logo-text h1, .logo-text .logo-title {
    font-size: 1.15rem;
  }
  
  .logo-text span {
    font-size: 0.6rem;
  }
}

/* Gallery Section */
.gallery-page-header {
  background: var(--secondary-dark);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
  border-bottom: 8px solid var(--primary);
}

.gallery-page-header h1 {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.gallery-page-header p {
  font-size: 1.2rem;
  color: #cbd5e1;
  text-align: left;
  display: inline-block;
  max-width: 1000px;
}

.gallery-section {
  padding: 80px 0 120px;
}

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

.gallery-group {
  margin-bottom: 3rem;
}

.gallery-group-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 20px;
}

.gallery-group-title {
  color: var(--secondary-dark);
  font-size: 1.8rem;
  margin: 0;
  white-space: nowrap;
}

.gallery-group-divider {
  flex-grow: 1;
  height: 2px;
  background-color: var(--primary);
  opacity: 0.5;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--secondary);
  transition: all 0.3s;
  height: 250px;
}

.gallery-item:hover {
  transform: translate(4px, -4px);
  box-shadow: -8px 8px 0 var(--primary);
  border-color: var(--primary);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  padding: 20px;
  border-top: 3px solid var(--primary);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

@media (max-width: 992px) {
  .gallery-item {
    height: auto;
  }
  .gallery-item img {
    height: 220px;
  }
  .gallery-overlay {
    position: relative;
    transform: translateY(0);
    border-top: none;
    border-bottom: 3px solid var(--primary);
    background: var(--secondary-dark);
  }
}

.gallery-overlay h3 {
  color: var(--primary);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.gallery-overlay p {
  color: var(--white);
  font-size: 0.9rem;
}

/* Lightbox Base CSS */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-zoom-wrap {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  max-height: 85vh;
  border: 4px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--primary);
}

.lightbox-caption {
  margin-top: 15px;
  text-align: center;
  color: var(--primary);
  font-size: 1.2rem;
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 1px;
  font-weight: 700;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--secondary);
  color: white;
  border: 2px solid var(--primary);
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  z-index: 10;
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0% 100%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--primary);
  color: var(--secondary-dark);
}

.lightbox-prev {
  left: 20px;
  clip-path: polygon(0 0, 80% 0, 100% 100%, 20% 100%);
}

.lightbox-next {
  right: 20px;
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination-top {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.pagination-bottom {
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  background-color: var(--white);
  color: var(--text-dark);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.pagination .page-link:hover {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination .page-link.active {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  pointer-events: none;
}

.pagination .page-link.prev-next {
  padding: 0 15px;
  gap: 8px;
}

/* Text Projects Section */
.text-projects-section {
  padding: 40px 0 20px;
}

.text-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

.text-project-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.text-project-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  border-left-color: var(--secondary-dark);
}

.text-project-item i {
  color: var(--primary);
  font-size: 1.5rem;
  margin-top: 2px;
}

.text-project-item:hover i {
  color: var(--secondary-dark);
}

.text-project-item span {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.5;
}

/* Partners & Affiliates Section */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.partner-card {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  border-top: 5px solid var(--secondary);
}

.partner-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.affiliate-card {
  border-top-color: var(--primary);
}

.affiliate-card:hover {
  border-color: var(--secondary-dark);
}

.partner-icon {
  width: 70px;
  height: 70px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--secondary-dark);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.partner-card:hover .partner-icon {
  background: var(--primary);
  color: var(--white);
}

.affiliate-card .partner-icon {
  color: var(--primary-dark);
  background: #fffbeb;
}

.affiliate-card:hover .partner-icon {
  background: var(--secondary-dark);
  color: var(--white);
}

.partner-info h3 {
  color: var(--secondary-dark);
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.partner-desc {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 20px;
  min-height: 48px;
}

.partner-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.partner-stats span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.partner-stats i {
  color: var(--primary);
}