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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #1f2937;
  --muted: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --radius: 1rem;
  --transition: all 0.3s ease;
  --top-bar-height: 38px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-bar-height) + 120px);
}

section[id] {
  scroll-margin-top: calc(var(--top-bar-height) + 120px);
}

html[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --accent: #fb923c;
  --bg: #0b1220;
  --surface: #111827;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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; }

/* Theme-aware overrides for Bootstrap utilities */
.bg-white, .bg-light, .bg-body { background-color: var(--bg) !important; }
.text-dark { color: var(--text) !important; }
.text-muted { color: var(--muted) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--border) !important; }
.form-control, .form-select, .input-group-text { background-color: var(--surface); color: var(--text); border-color: var(--border); }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25); }
.list-group-item { background-color: var(--surface); color: var(--text); border-color: var(--border); }
.dropdown-menu { background-color: var(--bg); border-color: var(--border); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--surface); color: var(--primary); }
.table { --bs-table-color: var(--text); --bs-table-bg: var(--surface); color: var(--text); background-color: var(--surface); border-color: var(--border); }
.table th, .table td { border-color: var(--border); }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: var(--surface); color: var(--text); }
.card, .modal-content, .offcanvas, .accordion-button:not(.collapsed) { background-color: var(--surface); color: var(--text); border-color: var(--border); }
.accordion-button { background-color: var(--surface); color: var(--text); }
.accordion-button::after { filter: invert(0.5); }
html[data-theme="dark"] .accordion-button::after { filter: invert(0.8); }
.pagination .page-link { background-color: var(--surface); color: var(--text); border-color: var(--border); }
.pagination .page-link:hover { background-color: var(--bg); color: var(--primary); }
.pagination .active .page-link { background-color: var(--primary); border-color: var(--primary); color: #fff; }
.badge.bg-secondary { background-color: var(--muted) !important; color: #fff; }

.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; }

.btn {
  border-radius: 0.75rem;
  font-weight: 500;
  padding: 0.65rem 1.4rem;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-gradient {
  background: linear-gradient(135deg, var(--accent), #ea580c);
  border: none;
  color: #fff;
}
.btn-gradient:hover { filter: brightness(1.1); color: #fff; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* Top bar */
.top-bar {
  position: relative;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  min-height: var(--top-bar-height);
  z-index: 1031;
}
.top-bar a { color: #e2e8f0; text-decoration: none; }
.top-bar a:hover { color: var(--accent); }
.top-bar i { color: var(--accent); }

/* Running marquee bar */
.marquee-bar {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.85rem;
  height: 40px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 1032;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  animation: marquee-ltr 80s linear infinite;
  will-change: transform;
}
.marquee-group {
  display: inline-flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 2rem;
  min-width: 100vw;
  padding: 0 1rem;
  box-sizing: border-box;
}
.marquee-group span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.marquee-group a { color: #e2e8f0; text-decoration: none; }
.marquee-group a:hover { color: var(--accent); }
@keyframes marquee-ltr {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* Navbar */
.navbar { padding: 0.75rem 0; transition: var(--transition); z-index: 1030; background: var(--bg); }
.navbar.fixed-top { position: sticky !important; top: 0 !important; }
.navbar.scrolled { box-shadow: var(--shadow); padding: 0.5rem 0; }
.navbar-brand { font-weight: 700; font-size: 1.5rem; color: var(--text); }
.navbar-brand span { font-size: 0.75rem; display: block; color: var(--muted); line-height: 1; }
.brand-logo { height: 40px; width: auto; }
.nav-link { font-weight: 500; color: var(--text); margin: 0 0.25rem; }
.nav-link:hover, .nav-link:focus { color: var(--primary); }
.navbar .btn-contact-us {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  animation: flicker 2s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(249,115,22,0); }
  50% { opacity: 0.92; box-shadow: 0 0 18px rgba(249,115,22,0.55); }
}
.navbar .btn-contact-us:hover { background: #15803d; color: #fff; }

/* Header buttons hover light green */
.navbar .nav-link:hover,
.navbar .dropdown-toggle:hover { color: #81c784 !important; }

.navbar .dropdown-toggle::after {
  content: '\f0d7';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  border: 0;
  margin-left: .35em;
  vertical-align: middle;
  color: currentColor;
}

.dropdown-menu { border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: rgba(37,99,235,0.08); color: var(--primary); }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  background: linear-gradient(135deg, rgba(15,23,42,0.92), rgba(15,23,42,0.75));
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 3.25rem; font-weight: 700; line-height: 1.2; }
.hero p.lead { color: rgba(255,255,255,0.85); font-size: 1.15rem; }
.hero .btn-light { background: #fff; color: var(--primary); font-weight: 600; }
.hero .btn-outline-light { border-color: rgba(255,255,255,0.4); color: #fff; }
.hero-shape {
  position: absolute; top: -10%; right: -5%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(249,115,22,0.25) 0%, transparent 70%);
  border-radius: 50%;
}

/* Sections */
.bg-surface { background: var(--surface) !important; }
.card { border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius); transition: var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.service-card, .product-card, .feature-card, .blog-card, .why-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  height: 100%;
}
.service-card:hover, .product-card:hover, .feature-card:hover, .blog-card:hover, .why-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.service-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(249,115,22,0.1));
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--primary); margin-bottom: 1rem;
}

/* Products */
#product-filters .filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 2rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  margin: 0.15rem;
}
#product-filters .filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
#product-filters .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.product-img { height: 220px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.price { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.old-price { text-decoration: line-through; color: var(--muted); font-size: 0.95rem; margin-right: 0.5rem; }
.discount-badge {
  background: #dcfce7; color: #15803d;
  font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 0.5rem;
}
html[data-theme="dark"] .discount-badge { background: rgba(21,128,61,0.25); color: #86efac; }

/* Testimonials */
.testimonial-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.testimonial-card img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }

/* FAQ */
.accordion-button { background: var(--surface); color: var(--text); font-weight: 500; }
.accordion-button:not(.collapsed) { background: var(--primary); color: #fff; }

/* Contact */
#contact { background: var(--surface); }
.form-control, .form-select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 0.75rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); background: var(--bg); color: var(--text);
}

/* Footer */
.footer { background: #0f172a; color: #cbd5e1; padding: 4rem 0 1.5rem; }
.footer a { color: #cbd5e1; text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer-brand { font-weight: 700; color: #fff; font-size: 1.25rem; }
.footer h5 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.social-fb { background: #1877F2; color: #fff; }
.social-ig { background: #E1306C; color: #fff; }
.social-li { background: #0A66C2; color: #fff; }
.social-yt { background: #FF0000; color: #fff; }
.social-fb:hover, .social-ig:hover, .social-li:hover, .social-yt:hover { color: #fff; opacity: 0.9; }

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

#scroll-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--primary); width: 0%; z-index: 1040; }

#back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow); z-index: 1020; cursor: pointer;
}

/* Chatbot */
.chatbot-toggle {
  position: fixed; bottom: 1.5rem; left: 1.5rem;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  box-shadow: var(--shadow); z-index: 1040;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.chatbot-window {
  position: fixed; bottom: 5rem; left: 1.5rem; width: 340px; max-height: 450px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); z-index: 1040; display: none; flex-direction: column;
}
.chatbot-header { padding: 0.75rem 1rem; background: var(--primary); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.chatbot-body { flex: 1; overflow-y: auto; padding: 1rem; }
.chat-bubble { padding: 0.5rem 0.9rem; border-radius: 0.75rem; margin-bottom: 0.5rem; max-width: 80%; font-size: 0.9rem; }
.chat-bubble.bot { background: var(--surface); color: var(--text); align-self: flex-start; }
.chat-bubble.user { background: var(--primary); color: #fff; align-self: flex-end; margin-left: auto; }
.chatbot-footer { padding: 0.75rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; }

/* Theme toggle */
#theme-toggle { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 50%; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }

/* Index hero */
#home {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  color: #fff; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background: url('../assets/images/hero.jpg') center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, rgba(15,23,42,0.92), rgba(15,23,42,0.75));
}
.hero-particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.35) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite alternate;
}
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-20px); } }
.hero-title { font-size: 3.25rem; font-weight: 700; color: #fff; }
.hero-title span { color: var(--accent); }
.hero-subtitle { color: rgba(255,255,255,0.85); font-size: 1.15rem; }

/* Blog & article pages */
.blog-hero, .faq-hero, .why-us-hero, .about-hero {
  position: relative; min-height: 60vh; display: flex; align-items: center;
  color: #fff; overflow: hidden; padding-top: 8rem;
}
.blog-hero .live-bg, .faq-hero .live-bg, .why-us-hero .live-bg, .about-hero .live-bg {
  position: absolute; inset: 0; z-index: -2;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  animation: kenburns 24s ease-in-out infinite alternate;
}
.blog-hero .live-bg { background-image: url('../assets/images/blog-hero.jpg'); }
.faq-hero .live-bg { background-image: url('../assets/images/faq-hero.jpg'); }
@keyframes kenburns { 0% { transform: scale(1) translate(0,0); } 100% { transform: scale(1.1) translate(-1%, -1%); } }
.hero-overlay-dark {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, rgba(8,13,23,0.9) 0%, rgba(8,13,23,0.72) 55%, rgba(8,13,23,0.55) 100%);
}
.why-us-hero .live-bg { background-image: url('../assets/images/why-us-hero.jpg'); }
.about-hero .live-bg { background-image: url('../assets/images/about-hero.jpg'); }
.hero-readable,
.hero-readable.lead,
.hero-readable p {
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.glass-card h5 { color: #fff; }
.glass-card p { color: rgba(255, 255, 255, 0.95); }
.bg-accent { background: var(--accent) !important; }
.min-vh-70 { min-height: 70vh; }

/* Account dashboard */
.account-page { min-height: 100vh; }
.account-hero { padding: 8rem 0 3rem; }
.auth-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.auth-card .nav-pills .nav-link {
  border-radius: 0; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent;
}
.auth-card .nav-pills .nav-link.active {
  color: var(--primary); background: transparent; border-bottom-color: var(--primary);
}
.account-sidebar {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.account-sidebar .list-group-item {
  border: none; border-left: 3px solid transparent; background: transparent;
  color: var(--text); font-weight: 500; cursor: pointer; transition: var(--transition);
}
.account-sidebar .list-group-item:hover,
.account-sidebar .list-group-item.active {
  background: var(--surface); color: var(--primary); border-left-color: var(--primary);
}
.account-sidebar .list-group-item i { width: 24px; text-align: center; color: var(--muted); }
.account-sidebar .list-group-item:hover i,
.account-sidebar .list-group-item.active i { color: var(--primary); }
.account-content {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-height: 600px;
}
.account-section { display: none; }
.account-section:not(.d-none) { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.avatar-wrapper { position: relative; display: inline-block; }
.avatar-wrapper img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 4px solid var(--primary); }
.avatar-wrapper .edit-avatar {
  position: absolute; bottom: 0; right: 0; width: 36px; height: 36px;
  background: var(--primary); color: #fff; border-radius: 50%; border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty-state i { color: var(--border); }

@media (max-width: 991px) {
  .account-sidebar { display: none; }
  .mobile-nav { display: block; }
  .account-hero { padding-top: 6rem; }
}
@media (min-width: 992px) {
  .mobile-nav { display: none; }
}
