/* --- 1. VARIABLES --- */
:root {
    /* Brand & Colors */
    --brand: #0E7C86;
    --brand-2: #CE7B2A;
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --white: #fff;

    /* Element Colors */
    --kim: #b5b7c0;
    --moc: #2e7d32;
    --thuy: #2563eb;
    --hoa: #d11f3b;
    --tho: #b8792a;

    /* Relation Colors */
    --color-sinh: hsl(160, 50%, 40%);
    --color-sinh-light: hsl(160, 50%, 96%);
    --color-khac: hsl(15, 80%, 55%);
    --color-khac-light: hsl(15, 80%, 97%);

    /* Layout & Shadow */
    --radius: 12px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --shadow-sm: 0 3px 8px hsla(210, 20%, 50%, 0.07);
    --shadow-md: 0 6px 16px hsla(210, 20%, 50%, 0.1);
    --shadow-card: 0 12px 32px rgba(15, 23, 42, .10);

}

.section { padding: 40px 0; }
.card { background: var(--white); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card); padding: 24px; }
.section-title { font-size: 32px; margin: 0 0 16px; }
.card-title { margin: 0 0 8px; }

.btn { display: inline-block; padding: 10px 20px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.btn-primary { background-color: var(--brand); color: var(--white); }
.btn-ghost { background-color: transparent; border: 1px solid var(--ink-300); color: var(--ink-700); }
.btn-outline-light { border: 1px solid var(--white); color: var(--white); }


/* --- 3. HERO SECTION --- */
.hero { position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(1000px 500px at 0% 0%, #d1f0f3 0, transparent 60%) no-repeat; }
.hero .wrap { position: relative; }
.hero-grid { display: grid; gap: 32px; grid-template-columns: 1.15fr .85fr; align-items: center; }
.hero-title { font-size: 46px; line-height: 1.1; margin: 0; }
.hero-description { color: var(--ink-600); max-width: 640px; margin: 16px 0 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-art { background: linear-gradient(135deg, #e6f3f4, var(--white)); border-radius: 28px; position: relative; min-height: 280px; }

.elements-grid {display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; text-align: center; }
.element-item {background: #fff; padding: 20px; border-radius: 8px; box-shadow: var(--box-shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.element-item:hover {transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); }
.element-item .icon {font-size: 3rem; }
.relations-container article {background: #fff; padding: 15px 20px; margin-bottom: 15px; border-left: 5px solid var(--secondary-color); border-radius: 5px; box-shadow: var(--box-shadow); }

/* --- 4. WHEEL --- */
.wheel-wrap { display: grid; place-items: center; }
.wheel-hint { margin: 8px 0 0; color: var(--ink-600); font-size: 13px; text-align: center; }
#wheel .sector-label-dark { fill: var(--ink-900); font-size: 14px; font-weight: 700; }
#wheel .sector-label-light { fill: var(--white); font-size: 14px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 12px; background: var(--ink-100); border: 1px solid var(--ink-200); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 999px; }
.dot.kim { background: var(--kim); } .dot.moc { background: var(--moc); } .dot.thuy { background: var(--thuy); } .dot.hoa { background: var(--hoa); } .dot.tho { background: var(--tho); }


/* --- 5. WUXING EXPLANATION --- */
.intro-card { background: hsl(30, 20%, 99%); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 2rem; margin-bottom: 3rem; font-size: 1.1rem; line-height: 1.8; }
.wuxing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.wuxing-column .column-header { font-size: 1.5rem; text-align: center; margin-bottom: 2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.column-sinh .column-header { color: var(--color-sinh); }
.column-khac .column-header { color: var(--color-khac); }
.wuxing-item { background: hsl(30, 20%, 99%); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 1.5rem; text-align: center; box-shadow: var(--shadow-sm); transition: all 0.3s ease; position: relative; margin-bottom: 1.5rem; }
.wuxing-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.column-sinh .wuxing-item { border-top: 4px solid var(--color-sinh); }
.column-khac .wuxing-item { border-top: 4px solid var(--color-khac); }
.wuxing-item h4 { margin: 0 0 1rem 0; font-size: 1.25rem; }
.emoji-sequence { font-size: 2.5rem; margin: 1rem 0; display: flex; justify-content: center; align-items: center; gap: 1rem; }
.emoji-sequence .operator { font-size: 1.5rem; font-weight: 700; color: var(--ink-500); }
.wuxing-item .explanation { font-size: 1rem; color: var(--ink-600); margin: 1rem 0 0 0; }


/* --- 6. TOOLS --- */
.tools-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-row { display: flex; gap: 10px; align-items: center; }
.tool-row input, .tool-row select { border: 1px solid var(--ink-300); border-radius: 12px; padding: 10px 12px; flex: 1; }
.tool-result { margin: 10px 0 0; color: var(--ink-700); }
.color-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.section-tool .card { max-width: 600px; margin: auto; }


/* --- 7. INTERACTIVE MATRIX --- */
.mx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mx-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mx-controls select { border: 1px solid var(--ink-300); border-radius: 12px; padding: 10px 12px; }
.mx-grid { display: grid; grid-template-columns: 64px repeat(5, 1fr); border: 1px solid var(--ink-200); border-radius: 16px; overflow: auto; margin-top: 12px; }
.mx-cell { padding: 10px 12px; border-right: 1px solid var(--ink-200); border-top: 1px solid var(--ink-200); background: var(--white); font-family: inherit; font-size: 14px; }
.mx-cell.head { background: var(--ink-100); font-weight: 700; text-align: center; }
.mx-cell[data-a] { cursor: pointer; text-align: center; }
.mx-cell.relation-sinh { background: var(--color-sinh-light); }
.mx-cell.relation-khac { background: var(--color-khac-light); }
.mx-cell.relation-eq { background: #f3f4f6; }
.mx-cell.selA { outline: 2px solid var(--brand); outline-offset: -2px; }
.mx-cell.selB { outline: 2px dashed var(--brand-2); outline-offset: -2px; }
.result-box { background: var(--ink-100); border: 1px solid var(--ink-200); border-radius: 14px; padding: 14px; margin-top: 10px; }
.badge { display: inline-block; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--ink-900); }
.b-sinh { background: var(--color-sinh-light); color: #065f63; }
.b-khac { background: var(--color-khac-light); color: #a1142a; }
.b-eq { background: #f3f4f6; }


/* --- 8. COLORS & CTA --- */
.colors-grid { display: grid; gap: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.swatch-group { display: flex; flex-direction: column; gap: 8px; }
.swatch { height: 56px; border-radius: 14px; border: 1px solid rgba(0, 0, 0, .05); }
.swatch-desc { color: var(--ink-600); font-size: 14px; margin-top: 8px; }

.cta-section { padding-top: 0; }
.cta-card { background: var(--ink-900); color: var(--white); }
.cta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 16px; }
.cta-title { font-size: 28px; margin: 0; }
.cta-description { color: var(--ink-300); }
.cta-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* FAQ */
.faq-item {
  background: white;
  border-radius: var(--radius-xl2);
  padding: 1rem;
  box-shadow: var(--shadow-card);
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}
.faq-item p, .faq-item ul {
  color: var(--cl-text-muted);
}
.faq-item + .faq-item {
  margin-top: 0.75rem;
}


/* --- 9. RESPONSIVE --- */
@media (max-width: 991px) {
    .tools-grid { grid-template-columns: 1fr; }
    .colors-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cta-grid { grid-template-columns: 1fr; text-align: center; }
    .cta-actions { justify-content: center; }

    .fs-45 { font-size: 37px; }
    .fs-35 { font-size: 30px; }
}

@media (max-width: 767px) {
    .section { padding: 30px 0; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-art { margin-top: 20px; }
    .hero-title { font-size: 36px; }
    .wuxing-grid { grid-template-columns: 1fr; gap: 3rem; }
    .colors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mx-controls { flex-direction: column; align-items: stretch; }

    .fs-45 { font-size: 32px; }
    .fs-35 { font-size: 25px; }
}