/* ============================================
   iBuilt Global - Common Styles
   Primary: Ant Design Blue (#1677ff)
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary-color: #1677ff;
  --primary-hover: #4096ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --primary-bg: #f0f5ff;

  --text-color: #1f1f1f;
  --text-secondary: #595959;
  --text-light: #8c8c8c;
  --text-white: #ffffff;

  --bg-white: #ffffff;
  --bg-light: #fafafa;
  --bg-section: #f5f7fa;
  --bg-dark: #001529;

  --border-color: #e8e8e8;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 8px 24px rgba(22, 119, 255, 0.25);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --container-max: 1200px;
  --header-height: 80px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  color: var(--text-color);
  background: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Lucide Icons --- */
.product-card-icon i,
.why-card-icon i,
.metamall-feature-icon i,
.metamall-flow-icon i,
.how-step-number i,
.no-wallet-feature-icon i {
  width: 28px;
  height: 28px;
}

.product-card-icon i {
  color: inherit;
}

.why-card-icon i {
  color: var(--primary-color);
}

.how-step-number i {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
}

.how-step:hover .how-step-number i {
  color: #fff;
}

.metamall-flow-icon i {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
}

.page-hero-badge i,
.metamall-hero-badge i {
  vertical-align: middle;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
.section-badge {
  display: inline-block;
  padding: 4px 16px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(22, 119, 255, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-white {
  background: var(--bg-white);
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-lg {
  padding: 14px 36px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn .btn-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* --- Header --- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: var(--transition);
  overflow: visible;
}

.app-header.scrolled {
  border-bottom-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.header-logo-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  max-width: none;
  max-height: none;
}

/* Placeholder logo using CSS */
.header-logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}

.header-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background: var(--primary-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-color);
  border-radius: 1px;
  transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Footer --- */
.app-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 24px 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand {
  flex-shrink: 0;
  max-width: 280px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 12px;
}

.footer-logo-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.footer-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.footer-slogan {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 4px;
}

.footer-link {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--primary-color);
}

.footer-info {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.footer-bottom {
  padding-top: 20px;
  text-align: center;
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-light);
}

/* --- Scroll Animation Classes --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered delay classes */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* --- Keyframe Animations --- */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* --- Star Rating --- */
.stars {
  display: flex;
  gap: 2px;
  font-size: 14px;
}

.star {
  color: #faad14;
}

.star.empty {
  color: #e8e8e8;
}

.star.half {
  position: relative;
  color: #e8e8e8;
}

.star.half::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #faad14;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .section-title {
    font-size: 30px;
  }

  .section-subtitle {
    font-size: 15px;
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    max-width: 100%;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }

  .header-logo-img {
    width: 52px;
    height: 52px;
  }

  .section-title {
    font-size: 26px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .container {
    padding: 0 16px;
  }

  /* Header Mobile */
  .mobile-menu-btn {
    display: flex;
  }

  .header-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .header-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }

  /* Footer Mobile */
  .footer-content {
    padding-top: 24px;
    padding-bottom: 16px;
  }

  .footer-top {
    gap: 20px;
    padding-bottom: 20px;
  }

  .footer-brand .footer-slogan {
    display: none;
  }

  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px 0;
  }

  .footer-col {
    flex: 0 0 50%;
    min-width: 0;
    gap: 6px;
  }

  .footer-bottom {
    padding-top: 14px;
  }

  .footer-copyright {
    font-size: 11px;
  }
}

/* Small phone */
@media (max-width: 480px) {
  .section-title {
    font-size: 22px;
  }

  .btn-lg {
    padding: 12px 24px;
    font-size: 14px;
  }

  .footer-links .footer-col {
    gap: 5px;
  }
}
