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

:root {
  --primary-color: #005A9C; /* Deep Corporate Blue */
  --secondary-color: #00B4D8; /* Bright Air Blue */
  --accent-color: #FFB703; /* Warning/Action Accent */
  --bg-color: #F8FAFC;
  --text-dark: #1E293B;
  --text-light: #64748B;
  --white: #FFFFFF;
  --nav-height: 80px;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
}

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

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

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

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

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

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand img {
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-dark);
  transition: color 0.3s;
  position: relative;
}

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

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

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

/* Dropdown CSS */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  min-width: 150px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 10px 0;
  z-index: 100;
}

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

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-weight: 400;
  color: var(--text-dark);
}

.dropdown-menu a::after {
  display: none;
}

.dropdown-menu a:hover {
  background-color: var(--bg-color);
  color: var(--primary-color);
}

.nav-contact {
  display: flex;
  gap: 15px;
  align-items: center;
}

.phone-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  padding: 8px 20px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.4);
  color: var(--white);
}

/* Mobile Menu */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  transition: 0.3s;
  border-radius: 3px;
}

/* Hero Section */
.hero {
  height: 80vh;
  margin-top: var(--nav-height);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/hero_bg.png') no-repeat center center/cover;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 15, 30, 0.8), rgba(0, 50, 90, 0.5));
  z-index: -1;
}

.hero-content {
  color: var(--white);
  max-width: 800px;
  animation: fadeInUp 1s ease forwards;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #E2E8F0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  background-color: var(--accent-color);
  color: #000;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.btn-primary:hover {
  background-color: #FFA000;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  background-color: transparent;
  color: var(--white);
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  border: 2px solid var(--white);
  transition: all 0.3s;
}

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

/* Section Common */
.section {
  padding: 80px 5%;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 50px;
  font-size: 1.1rem;
}

/* Services Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 180, 216, 0.15);
}

.service-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.service-info {
  padding: 25px;
}

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

/* Feature Block */
.feature-container {
  display: flex;
  align-items: center;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-text {
  flex: 1;
}

.feature-text h2 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.feature-text p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.feature-image {
  flex: 1;
  position: relative;
}

.feature-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Contact Section */
.contact-section {
  background: linear-gradient(135deg, var(--primary-color), var(--text-dark));
  color: var(--white);
  padding: 80px 5%;
}

.contact-section .section-title, .contact-section .section-subtitle {
  color: var(--white);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
}

.contact-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.contact-card p {
  color: #E2E8F0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qr-placeholder {
  width: 150px;
  height: 150px;
  background: #FFF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: bold;
  margin-top: 20px;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: var(--text-light);
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* Page Header for subpages */
.page-header {
  height: 40vh;
  margin-top: var(--nav-height);
  background: linear-gradient(135deg, var(--primary-color), var(--text-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
}

.page-header h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* Tabs CSS */
.tab-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: -30px auto 40px auto;
  max-width: 800px;
}

.tab-btn {
  padding: 12px 30px;
  border-radius: 30px;
  background-color: var(--white);
  color: var(--text-dark);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #E2E8F0;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.tab-btn:hover {
  background-color: var(--bg-color);
  transform: translateY(-2px);
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 90, 156, 0.3);
}

.tab-content {
  display: none;
  animation: fadeInTab 0.5s ease-in-out forwards;
}

.tab-content.active {
  display: block;
}

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

/* Lightbox Styles */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-img {
  max-width: 90%; max-height: 90vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 5px 30px rgba(0,0,0,0.5);
  transform: scale(0.9); transition: transform 0.3s ease;
}
.lightbox-overlay.active .lightbox-img { transform: scale(1); }
.zoomable { cursor: zoom-in; transition: opacity 0.2s; }
.zoomable:hover { opacity: 0.9; }

/* Error Code Table & Troubleshooting */
.error-code-table {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 40px;
}
.error-code-table th { background: var(--primary-color); color: white; padding: 15px 20px; text-align: left; font-size: 1.1rem; }
.error-code-table td { padding: 15px 20px; border-bottom: 1px solid #eee; color: var(--text-dark); line-height: 1.5; }
.error-code-table tbody tr:nth-child(even) { background-color: #f8fbff; }
.error-code-table tbody tr:hover { background-color: #e6f3ff; transition: 0.2s; }
.error-code-table .code-cell { font-weight: bold; color: var(--accent-color); font-size: 1.1rem; }
.remote-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0, 180, 216, 0.2); }

/* Media Queries */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
  }
  
  .nav-links.active {
    left: 0;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    text-align: center;
    background-color: transparent;
  }
  
  .dropdown:hover .dropdown-menu, .dropdown:active .dropdown-menu, .dropdown:focus-within .dropdown-menu {
    display: block;
  }
  
  .nav-contact {
    display: none;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .btn-primary, .btn-secondary {
    padding: 10px 20px;
    font-size: 1rem;
  }
  
  .tab-container {
    gap: 10px;
  }
  .tab-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
  
  .error-code-table th, .error-code-table td {
    padding: 10px;
    font-size: 0.9rem;
  }
  
  .feature-container {
    flex-direction: column;
  }
  
  .btn-secondary {
    margin-left: 0;
    margin-top: 15px;
  }
}
