﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Aquamarine palette */
  --aqua: #7fffd4;
  --aqua-strong: #3de8b0;
  --aqua-deep: #00c896;
  --aqua-glow: rgba(127, 255, 212, 0.25);
  --aqua-dim: rgba(127, 255, 212, 0.08);

  --bg: #0a0f1a;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --text: #e8ecf1;
  --text-muted: #8892a4;
  --stroke: rgba(127, 255, 212, 0.12);
  --stroke-hover: rgba(127, 255, 212, 0.3);
  --orange: #ff8c42;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(127, 255, 212, 0.15);
  --radius: 12px;
  --radius-sm: 6px;
}

/* Giao diện Sáng */
[data-theme="light"] {
  --bg: #f0f4f8;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --text: #1a202c;
  --text-muted: #5a6578;
  --stroke: rgba(0, 150, 100, 0.15);
  --stroke-hover: rgba(0, 150, 100, 0.35);
  --aqua: #00a878;
  --aqua-strong: #009966;
  --aqua-deep: #007a55;
  --aqua-glow: rgba(0, 168, 120, 0.15);
  --aqua-dim: rgba(0, 168, 120, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(0, 168, 120, 0.1);
}

[data-theme="light"] .bg-glow {
  display: none;
}

/* Top bar & Header */
[data-theme="light"] .top-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .main-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
}

[data-theme="light"] .brand-mark {
  color: #1a202c;
}

[data-theme="light"] .search-bar input {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .search-bar button {
  color: #fff;
}

/* Category nav */
[data-theme="light"] .category-nav {
  background: linear-gradient(90deg, #00a878, #009966);
}

[data-theme="light"] .category-nav a {
  color: #fff;
}

[data-theme="light"] .category-nav .all-categories {
  color: #fff;
}

/* Cards & surfaces */
[data-theme="light"] .card,
[data-theme="light"] .blog-card,
[data-theme="light"] .proj-card,
[data-theme="light"] .learn-card,
[data-theme="light"] .feat-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Action icons */
[data-theme="light"] .action-icon {
  color: var(--text-muted);
}

[data-theme="light"] .action-icon:hover {
  color: var(--aqua-deep);
}

/* Footer */
[data-theme="light"] .footer {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="light"] .footer .brand-mark {
  color: #fff;
}

[data-theme="light"] .footer a {
  color: #94a3b8;
}

[data-theme="light"] .footer a:hover {
  color: #fff;
}

[data-theme="light"] .footer h4 {
  color: #e2e8f0;
}

/* Hero section text stays readable */
[data-theme="light"] .hero {
  background: linear-gradient(135deg, #e8f5f0 0%, #f0f4f8 60%);
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(135deg,
      rgba(240, 244, 248, 0.92) 0%,
      rgba(240, 244, 248, 0.7) 50%,
      rgba(240, 244, 248, 0.45) 100%);
}

[data-theme="light"] .hero h1,
[data-theme="light"] .hero .lead {
  color: #1a202c;
}

[data-theme="light"] .hero h1 .gradient-text {
  background: linear-gradient(135deg, #00a878, #007a55);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-badge {
  background: rgba(0, 168, 120, 0.12);
  border-color: rgba(0, 168, 120, 0.25);
  color: #007a55;
}

[data-theme="light"] .hero-feature-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-stats .stat-number {
  color: #007a55;
}

[data-theme="light"] .btn-ghost {
  color: var(--text);
  border-color: var(--stroke);
}

[data-theme="light"] .btn-ghost:hover {
  border-color: var(--aqua-deep);
  color: var(--aqua-deep);
}

[data-theme="light"] .accent {
  color: var(--aqua-deep);
}

/* Toast */
[data-theme="light"] .toast.show {
  background: var(--aqua-deep);
  color: #fff;
}

/* Nút chuyển Sáng / Tối */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.25s;
  white-space: nowrap;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--aqua);
  color: #000;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  outline: none;
}

.container {
  width: min(1240px, 92vw);
  margin: 0 auto;
}

/* ═══════ TOP BAR ═══════ */
.top-bar {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 7px 0;
  letter-spacing: 0.02em;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-links,
.top-bar-right {
  display: flex;
  gap: 18px;
}

.top-bar a:hover {
  color: var(--aqua);
}

/* ═══════ MAIN HEADER ═══════ */
.main-header {
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(20px);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--stroke);
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}

.brand-mark span {
  color: var(--aqua);
}

.search-bar {
  flex-grow: 1;
  max-width: 520px;
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  transition: border-color 0.3s;
}

.search-bar:focus-within {
  border-color: var(--aqua);
  box-shadow: var(--shadow-glow);
}

.search-bar input {
  width: 100%;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: none;
  font-size: 0.92rem;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: var(--aqua-deep);
  color: #000;
  border: none;
  padding: 0 22px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}

.search-bar button:hover {
  background: var(--aqua-strong);
}

.header-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.action-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.action-icon:hover {
  color: var(--aqua);
}

.cart-icon {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════ CATEGORY NAV ═══════ */
.category-nav {
  background: linear-gradient(90deg, var(--aqua-deep), #00a07a);
  color: #000;
}

.category-nav .container {
  display: flex;
  gap: 0;
}

.category-nav a {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.category-nav a:hover {
  background: rgba(0, 0, 0, 0.15);
}

.category-nav .all-categories {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

/* ═══════ HERO ═══════ */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

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

.hero-video video,
.hero-video iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 0;
}

.hero-content .container {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--aqua-dim);
  border: 1px solid var(--stroke);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--aqua);
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
  font-family: 'JetBrains Mono', monospace;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aqua);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 var(--aqua-glow);
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 8px transparent;
  }
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-deep), #00e5a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--stroke);
}

.hero-stats .stat-number {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--aqua);
}

.hero-stats .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Hero featured card */
.hero-feature-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  max-width: 360px;
  justify-self: end;
}

.hero-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--aqua), var(--aqua-deep), transparent);
}

/* ═══════ BUTTONS ═══════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--aqua-deep), var(--aqua-strong));
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 200, 150, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 200, 150, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--aqua);
  border: 1px solid var(--stroke-hover);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: var(--aqua-dim);
  border-color: var(--aqua);
}

/* ═══════ SECTIONS ═══════ */
.section-padding {
  padding: 80px 0;
}

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

.section-head h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-head h2 .accent {
  color: var(--aqua);
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 16px;
  margin-bottom: 32px;
}

.section-head-row a {
  color: var(--aqua);
  font-size: 0.9rem;
  font-weight: 600;
}

.section-head-row a:hover {
  text-decoration: underline;
}

/* ═══════ GRIDS ═══════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

/* ═══════ CARDS ═══════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}

.card:hover {
  border-color: var(--stroke-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.card-img {
  aspect-ratio: 1;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.card-img img {
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s;
}

.card:hover .card-img img {
  transform: scale(1.06);
}

.card h3 {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card h3:hover {
  color: var(--aqua);
}

.card-meta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aqua);
}

.btn-add-cart {
  background: transparent;
  color: var(--aqua);
  border: 1px solid var(--aqua);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: 'Inter', sans-serif;
}

.card:hover .btn-add-cart {
  background: var(--aqua-deep);
  color: #000;
  border-color: var(--aqua-deep);
}

/* Badges */
.badge-new {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 8px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', monospace;
  z-index: 2;
}

/* ═══════ FOOTER ═══════ */
.footer {
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--stroke);
  color: var(--text-muted);
  padding: 64px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 18px;
  font-weight: 600;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.footer ul a:hover {
  color: var(--aqua);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
  font-size: 0.82rem;
  color: #555;
}

/* ═══════ TOAST ═══════ */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--aqua-deep), var(--aqua-strong));
  color: #000;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0, 200, 150, 0.3);
  transform: translateX(140%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
}

.toast.show {
  transform: translateX(0);
}

/* ═══════ AMBIENT BG ═══════ */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: var(--aqua);
  top: -200px;
  left: -100px;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: #00a07a;
  bottom: -150px;
  right: -150px;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 960px) {
  .top-bar {
    display: none;
  }

  .category-nav .container {
    overflow-x: auto;
  }

  .main-header .container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .search-bar {
    max-width: none;
    order: 3;
    width: 100%;
  }

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

  .hero-content .container {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-feature-card {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
    /* Space for bottom nav */
  }

  .header-actions {
    display: none;
    /* Hide header cart/account on mobile */
  }

  .main-header {
    justify-content: center;
  }

  .brand {
    margin: 0 auto;
  }

  .search-bar {
    width: 100%;
    margin-top: 10px;
  }

  .music-player {
    bottom: 80px;
    /* Move up above bottom nav */
  }
}

@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 0 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  /* Force 2 columns on very small screens */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card {
    padding: 10px;
  }

  .card-img {
    height: 140px;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-price {
    font-size: 1rem;
  }
}

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  width: 20%;
  transition: color 0.2s;
  position: relative;
}

.mobile-nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.mobile-nav-item.active {
  color: var(--aqua);
}

.mobile-nav-item.active svg {
  stroke-width: 2;
  color: var(--aqua);
}

.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: calc(50% - 16px);
  background: var(--danger, #ff4d4f);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1;
  display: none;
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* YÊU CẦU MỚI: Music Player & Cart GIF Overlay */
.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 200, 0.1);
  z-index: 9998;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.music-player:hover {
  border-color: var(--stroke-hover);
  box-shadow: var(--shadow-glow);
}

.music-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.music-btn {
  background: transparent;
  border: none;
  color: var(--aqua);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all 0.2s;
}

.music-btn:hover {
  background: rgba(0, 255, 200, 0.1);
}

.music-info {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
}

.music-marquee {
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.music-marquee-text {
  display: inline-block;
  animation: marquee 10s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}