/* iFLocus Website - Main Stylesheet */
:root {
  --primary: #0066cc;
  --primary-dark: #004a99;
  --accent: #ff6600;
  --text: #333333;
  --text-light: #666666;
  --bg-light: #f8f9fa;
  --bg-dark: #1a1a2e;
  --white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Noto Sans TC', sans-serif;
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER / NAVBAR ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

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

.nav-logo {
  flex-shrink: 0;
}
.nav-logo img {
  height: 44px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: var(--primary);
  background: rgba(0,102,204,0.07);
}

/* Dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  min-width: 180px;
  padding: 8px 0;
  list-style: none;
  z-index: 200;
  border: 1px solid var(--border);
}

.nav-menu > li:hover .dropdown-menu { display: block; }

.dropdown-menu li a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--text);
  transition: all 0.2s;
}

.dropdown-menu li a:hover {
  background: var(--bg-light);
  color: var(--primary);
  padding-left: 24px;
}

.nav-contact-btn {
  background: var(--primary);
  color: var(--white) !important;
  border-radius: 20px !important;
  padding: 8px 20px !important;
}
.nav-contact-btn:hover {
  background: var(--primary-dark);
  color: var(--white) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  width: 26px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
  display: block;
}

/* ===== HERO BANNER / SLIDER ===== */
.hero-slider {
  position: relative;
  overflow: hidden;
  margin-top: 72px;
}

.hero-slider .slide {
  display: none;
  position: relative;
  width: 100%;
  min-height: 600px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #16213e 50%, #0f3460 100%);
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.hero-slider .slide.active { display: flex; }

.slide-content {
  max-width: 800px;
  padding: 80px 24px;
  z-index: 2;
}

.slide-content h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.slide-content p {
  font-size: clamp(16px, 2vw, 20px);
  opacity: 0.85;
  margin-bottom: 36px;
}

.slide-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,66,140,0.75), rgba(0,30,60,0.85));
  z-index: 1;
}

.slide-bg-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slider-controls {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.slider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.slider-dot.active { background: var(--white); transform: scale(1.3); }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.slider-arrow:hover { background: rgba(255,255,255,0.3); }
.slider-arrow.prev { left: 24px; }
.slider-arrow.next { right: 24px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,102,204,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-accent:hover {
  background: #cc5200;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,102,0,0.35);
}

/* ===== SECTIONS ===== */
section { padding: 80px 0; }

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text);
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 56px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section-title-accent {
  color: var(--primary);
}

/* ===== CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

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

.card-body {
  padding: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-text {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.7;
}

/* ===== STATS ===== */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 48px 0;
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 160px;
}

.stat-number {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
}

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.feature-item {
  text-align: center;
  padding: 32px 24px;
  border-radius: 16px;
  background: var(--bg-light);
  transition: all 0.3s;
}
.feature-item:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-4px);
}
.feature-item:hover .feature-icon { filter: brightness(10); }
.feature-item:hover .feature-title,
.feature-item:hover .feature-text { color: var(--white); }

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.feature-text {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 80px 24px;
}

.cta-section h2 {
  font-size: clamp(24px, 4vw, 38px);
  margin-bottom: 16px;
}

.cta-section p {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 36px;
}

/* ===== PAGE HERO (non-home pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0f3460 100%);
  color: var(--white);
  padding: 120px 24px 80px;
  text-align: center;
  margin-top: 72px;
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 18px;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== TWO-COLUMN LAYOUT ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }

.two-col img {
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
}

.two-col-text h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.two-col-text p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 12px;
  font-size: 15px;
}

/* ===== PRICING ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.pricing-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.3s;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.04);
}

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 18px;
  border-radius: 20px;
  white-space: nowrap;
}

.pricing-plan {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-light);
}

.pricing-desc {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 28px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #0d1117;
  color: rgba(255,255,255,0.75);
  padding: 64px 0 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.7;
  margin-bottom: 16px;
}

.footer-email {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.footer-col h4 {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

.footer-col ul { list-style: none; }

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--white);
}

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

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px; height: 48px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,102,204,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 500;
}
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }
.back-to-top.show { display: flex; }

/* ===== CONTACT FORM ===== */
.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--white);
  padding: 48px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--white);
}

.form-group textarea { height: 140px; resize: vertical; }

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0,102,204,0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== NEWS GRID ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.news-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}
.news-card:hover { transform: translateY(-6px); }

.news-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-light);
}

.news-card-body { padding: 24px; }

.news-date {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-card-excerpt {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
  background: linear-gradient(135deg, rgba(0,102,204,0.08), rgba(0,102,204,0.02));
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin: 24px 0;
}

/* ===== STEP LIST ===== */
.steps-list {
  list-style: none;
  counter-reset: step-counter;
}

.steps-list li {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: flex-start;
  counter-increment: step-counter;
}

.step-num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.step-text h4 { font-size: 17px; margin-bottom: 6px; }
.step-text p { font-size: 14px; color: var(--text-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .two-col {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    gap: 0;
  }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { padding: 12px 16px; }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 4px 8px;
    display: none;
  }
  .nav-menu > li.open .dropdown-menu { display: block; }
  .nav-hamburger { display: flex; }

  section { padding: 56px 0; }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .two-col.reverse { direction: ltr; }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .contact-form { padding: 28px 20px; }

  .slider-arrow { display: none; }

  .pricing-card.featured { transform: scale(1); }
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .stats-row { gap: 16px; }
  .features-grid { grid-template-columns: 1fr; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.bg-light { background: var(--bg-light); }
.bg-dark { background: var(--bg-dark); color: var(--white); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0 !important; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
