/* Hanulink Technologies - Premium Smart Home Website Styles */

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --accent: #84cc16;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius: 1rem;
  --transition: all 0.3s ease;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; }
a { color: var(--primary); text-decoration: none; }

.section-padding { padding: 5rem 0; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title p { color: var(--muted); max-width: 600px; margin: 0 auto; }

.ls-2 { letter-spacing: 0.1em; }

/* Preloader */
#preloader {
  position: fixed; inset: 0; z-index: 9999; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}
#preloader.hide { opacity: 0; visibility: hidden; }
.spinner {
  width: 50px; height: 50px; border: 4px solid var(--surface);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scroll progress */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%; z-index: 1100; transition: width 0.1s;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
html[data-theme="dark"] .navbar { background: rgba(11, 18, 32, 0.8); }
.navbar.scrolled { box-shadow: var(--shadow); background: rgba(255, 255, 255, 0.95); }
html[data-theme="dark"] .navbar.scrolled { background: rgba(11, 18, 32, 0.95); }
.navbar-brand { font-weight: 700; font-size: 1.5rem; display: flex; align-items: center; gap: 0.35rem; color: var(--text) !important; }
.navbar-brand img { height: 40px; width: auto; }
.brand-main { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; }
.brand-tech {
  display: block;
  font-size: 0.55em;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary-dark), #064e3b);
  border-radius: 4px;
  padding: 0.15em 0.55em;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
  width: max-content;
}
.nav-link { font-weight: 500; color: var(--text) !important; position: relative; }
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
  background: var(--primary); transition: var(--transition); transform: translateX(-50%);
}
.nav-link:hover::after { width: 70%; }
.nav-link:hover { color: var(--primary) !important; }
.navbar-toggler { border-color: var(--border); }
html[data-theme="dark"] .navbar-toggler-icon { filter: invert(1); }

/* Buttons */
.btn-gradient {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff; border: none; border-radius: 50rem; padding: 0.75rem 1.5rem;
  font-weight: 500; transition: var(--transition);
}
.btn-gradient:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3); color: #fff; }
.btn-outline-gradient {
  border: 2px solid var(--primary); color: var(--primary); border-radius: 50rem;
  padding: 0.75rem 1.5rem; font-weight: 500; transition: var(--transition); background: transparent;
}
.btn-outline-gradient:hover { background: var(--primary); color: #fff; }

.green-section {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #84cc16 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.green-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 80V0h80' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.green-section .section-title h2 { background: none; -webkit-background-clip: initial; -webkit-text-fill-color: #fff; color: #fff; }
.green-section .section-title p { color: #fff; -webkit-text-fill-color: #fff; }
.green-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}
.green-card:hover { transform: translateY(-6px); background: rgba(255, 255, 255, 0.18); }
.green-icon {
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 1rem;
}

/* Hero */
#home {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding-top: 6rem; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background: url('../assets/images/hero.jpg') center/cover no-repeat;
  transform: scale(1.05);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, rgba(11, 18, 32, 0.88) 0%, rgba(11, 18, 32, 0.55) 60%, rgba(5, 150, 105, 0.25) 100%);
}
.hero-particle {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.06);
  animation: float 8s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
.hero-title { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 700; color: #fff; line-height: 1.15; }
.hero-title span { color: var(--primary); }
.hero-subtitle { color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; max-width: 540px; }

/* Stats */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; box-shadow: var(--shadow); transition: var(--transition);
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card h3 { font-size: 2rem; color: var(--primary); margin-bottom: 0.25rem; }
.stat-card p { color: var(--muted); margin: 0; }

/* Product card */
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); position: relative;
}
.product-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12); }
.product-img-wrap { position: relative; height: 220px; overflow: hidden; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .product-img-wrap img { transform: scale(1.08); }
.product-badge { position: absolute; top: 12px; left: 12px; border-radius: 50rem; padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-quickview {
  position: absolute; bottom: 12px; right: 12px; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.9); border: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px); transition: var(--transition);
}
.product-card:hover .btn-quickview { opacity: 1; transform: translateY(0); }
.price { font-weight: 700; font-size: 1.1rem; color: var(--primary); }

/* Filters */
.filter-btn {
  border-radius: 50rem; padding: 0.5rem 1.2rem; font-weight: 500; margin: 0.25rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: var(--transition);
}
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Service card */
.service-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; box-shadow: var(--shadow); transition: var(--transition); height: 100%;
}
.service-card:hover { transform: translateY(-6px); }
.service-icon {
  width: 70px; height: 70px; border-radius: 50%; background: rgba(5, 150, 105, 0.1);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 1rem; transition: var(--transition);
}
.service-card:hover .service-icon { background: var(--primary); color: #fff; }

/* Cart */
.offcanvas { background: var(--surface); color: var(--text); }
.offcanvas-header, .offcanvas-footer { background: var(--surface); border-color: var(--border) !important; }
.cart-thumb { width: 55px; height: 55px; object-fit: cover; border-radius: 0.5rem; }
.cart-item { background: var(--bg); border: 1px solid var(--border); }

/* Testimonial */
.testimonial-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow);
}
.testimonial-card img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; }

/* FAQ */
.accordion-item { background: var(--surface); border: 1px solid var(--border) !important; }
.accordion-button { background: var(--surface); color: var(--text); }
.accordion-button:not(.collapsed) { background: var(--surface); color: var(--primary); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: var(--border); }
html[data-theme="dark"] .accordion-button::after { filter: invert(1); }
.accordion-body { background: var(--bg); color: var(--text); }

/* Footer */
.footer { background: #0b1220; color: #cbd5e1; padding: 4rem 0 1.5rem; }
.footer a { color: #94a3b8; text-decoration: none; }
.footer a:hover { color: #fff; }
.footer-brand { font-weight: 700; font-size: 1.5rem; color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.footer-brand img { height: 40px; }

/* Back to top */
#back-to-top {
  position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--primary); color: #fff; border: none;
  opacity: 0; visibility: hidden; transition: var(--transition); z-index: 1000;
}
#back-to-top.show { opacity: 1; visibility: visible; }

/* Modals */
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--border) !important; }

/* Forms */
.form-control, .form-select {
  background: var(--bg); color: var(--text); border-color: var(--border);
}
.form-control:focus, .form-select:focus {
  background: var(--bg); color: var(--text); border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(5, 150, 105, 0.25);
}

/* Utility */
.bg-surface { background: var(--surface) !important; }
.text-muted { color: var(--muted) !important; }
.border { border-color: var(--border) !important; }

@media (max-width: 991.98px) {
  .hero-title { font-size: 2.2rem; }
  .section-padding { padding: 3.5rem 0; }
}
