/* ============================================================
   專業汽車維修中心 - Professional Auto Repair Centre
   Dark Industrial Palette + Safety Orange Accent
   Bootstrap 5.3 + Custom Theme
   Dials: VARIANCE=5, MOTION=4, DENSITY=5
   ============================================================ */

/* --- CSS Custom Properties (Light / Dark via data-theme) --- */
:root {
  --font-display: 'Saira Semi Condensed', 'Noto Sans TC', sans-serif;
  --font-body: 'Noto Sans TC', sans-serif;

  /* Light mode (default) */
  --bg-primary: #f7f7f5;
  --bg-secondary: #eeeeec;
  --bg-surface: #ffffff;
  --bg-elevated: #f0f0ee;
  --bg-nav: rgba(255, 255, 255, 0.92);

  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-muted: #8a8a8a;

  --accent: #e85d04;
  --accent-hover: #cc4f00;
  --accent-glow: rgba(232, 93, 4, 0.15);

  --border: #e0e0dc;
  --border-light: #eeeeea;

  --danger: #c1121f;
  --success: #2d6a4f;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);

  --nav-height: 68px;
}

[data-theme="dark"] {
  --bg-primary: #0f0f0f;
  --bg-secondary: #151515;
  --bg-surface: #1c1c1c;
  --bg-elevated: #242424;
  --bg-nav: rgba(15, 15, 15, 0.94);

  --text-primary: #f0f0f0;
  --text-secondary: #999999;
  --text-muted: #6b6b6b;

  --accent: #ff6b00;
  --accent-hover: #e85d04;
  --accent-glow: rgba(255, 107, 0, 0.20);

  --border: #2a2a2a;
  --border-light: #1f1f1f;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.50);
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.display-headline {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }

/* --- Buttons --- */
.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.65rem 1.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-accent:active {
  transform: scale(0.97);
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

.btn-outline-accent:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-outline-accent:active {
  transform: scale(0.97);
}

/* --- Navigation --- */
.navbar-custom {
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
  transition: background-color 0.3s ease;
  z-index: 1030;
}

.navbar-custom .nav-link {
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
  border-radius: var(--radius-sm);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--accent);
}

.navbar-brand-custom {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.navbar-brand-custom:hover { color: var(--accent); }

.navbar-brand-custom .brand-icon {
  color: var(--accent);
  font-size: 1.3rem;
  margin-right: 0.35rem;
}

/* --- Hero --- */
.hero-section {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,15,15,0.88) 0%, rgba(15,15,15,0.60) 50%, rgba(15,15,15,0.85) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--nav-height);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid rgba(255,107,0,0.3);
  border-radius: var(--radius-full);
  background: rgba(255,107,0,0.08);
}

/* --- Sections --- */
.section-padding {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 55ch;
}

/* --- Stats --- */
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* --- Cards --- */
.card-custom {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  overflow: hidden;
}

.card-custom:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card-custom .card-body {
  padding: 1.75rem;
}

.card-custom .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.card-custom .card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Service Cards --- */
.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.service-card .service-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.service-card .service-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

/* --- Blog Cards --- */
.blog-card .blog-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.blog-card .blog-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-img-wrap img {
  transform: scale(1.04);
}

.blog-card .blog-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* --- Contact Form --- */
.form-custom .form-control {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-custom .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.form-custom .form-control::placeholder {
  color: var(--text-muted);
}

.form-custom .form-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-custom .form-text {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* --- Footer --- */
.footer-custom {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
}

.footer-custom h6 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.footer-custom a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-custom a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Pagination --- */
.pagination-custom .page-link {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  margin: 0 3px;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination-custom .page-link:hover {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: var(--accent);
}

.pagination-custom .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pagination-custom .page-item.disabled .page-link {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-muted);
  pointer-events: none;
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  opacity: 1;
}

/* --- Logo wall --- */
.logo-wall-item {
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.logo-wall-item:hover {
  filter: grayscale(0);
  opacity: 1;
}

/* --- Badge --- */
.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
  padding: 0.3em 0.75em;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Thank You Page --- */
.thank-you-icon {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* --- Full Screen BG Section --- */
.fullscreen-bg-section {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.fullscreen-bg-section .bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fullscreen-bg-section .bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fullscreen-bg-section .bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,15,15,0.92) 0%, rgba(15,15,15,0.55) 100%);
  z-index: 1;
}

.fullscreen-bg-section .bg-content {
  position: relative;
  z-index: 2;
}

/* --- Info Row (contact details) --- */
.info-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  font-size: 1.15rem;
}

/* --- Responsive --- */
@media (max-width: 767.98px) {
  .section-padding {
    padding: 3rem 0;
  }

  .hero-section {
    min-height: 100dvh;
    text-align: left;
  }

  .navbar-custom {
    height: auto;
    min-height: 60px;
  }

  .stat-number {
    font-size: 1.8rem;
  }
}
