/* --- 1. VARIABLES & GENERAL STYLES --- */
:root {
    /* Light Theme */
    --brand: #b45309;
    --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;
    --shadow-card: 0 12px 32px rgba(15, 23, 42, .10);

    /* Dark Theme */
    --color-primary: hsl(195, 85%, 55%);
    --color-secondary: hsl(280, 60%, 70%);
    --color-accent: hsl(45, 90%, 65%);
    --color-text-light: hsl(210, 25%, 90%);
    --color-text: hsl(210, 20%, 75%);
    --color-text-dark: hsl(0, 0%, 100%);
    --color-background: hsl(220, 25%, 10%);
    --color-surface: hsl(215, 30%, 15%);
    --color-border: hsla(210, 20%, 70%, 0.2);
    --shadow-glow: 0 0 40px hsla(195, 85%, 55%, 0.2);

}

/* --- 2. COMPONENTS --- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 24px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 14px 18px; border: 1px solid var(--ink-300); background: #fff; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--brand); color: #fff; border-color: transparent; }
.result-box { background: #f8fafc; border: 1px solid var(--ink-200); border-radius: 14px; padding: 14px; margin-top: 12px; }
.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #f3f4f6; font-size: 13px; margin-right: 6px; margin-bottom: 6px; }
.badge { display: inline-block; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #0f172a; }
.b-sinh { background: #e6f3f4; color: #065f63; }
.b-khac { background: #fdecec; color: #a1142a; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin-top: 12px; border-top: 1px solid var(--ink-200); padding-top: 12px; }
.swatch-mini { display: inline-block; width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .06); margin: 0 4px -4px 4px; }
.placeholder-text { color: var(--ink-700); }
.section-title { font-size: 32px; margin: 0 0 24px; text-align: center; color: var(--color-text-dark); font-family: var(--font-serif); }

/* --- 3. SECTIONS --- */
/* Tool Section */
.section-tool { padding: 60px 0; background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.1), transparent 60%)}
.page-description { color: var(--ink-600); margin: auto; max-width: 600px; }
.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: 12px 14px; flex: 1; }
.tool-row select { flex: 0.4; }

/* Tra cứu Box*/
.section-tool .tool-content { position: relative; z-index: 2; text-align: center; max-width: 800px; margin: 0 auto; }
.section-tool .card {
    background: var(--glass); backdrop-filter: blur(20px);
    padding: 40px; border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}




/* Explore Section */
.section-explore { padding: 48px 0; }
.wuxing-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.wuxing-card { position: relative; height: 400px; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--color-text-dark); box-shadow: 0 10px 30px hsla(0, 0%, 0%, 0.3); transition: transform 0.4s ease, box-shadow 0.4s ease; }
.wuxing-card:hover { transform: translateY(-15px) scale(1.05); box-shadow: 0 20px 40px hsla(0, 0%, 0%, 0.4); color: var(--color-text)}
.wuxing-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.wuxing-card:hover img { transform: scale(1.1); }
.wuxing-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, hsla(220, 25%, 5%, 0.9) 20%, hsla(220, 25%, 5%, 0)); z-index: 1; }
.wuxing-content { position: absolute; bottom: 0; left: 0; padding: 1.5rem; z-index: 2; width: 100%; }
.wuxing-title { font-family: var(--font-serif); font-size: 1.75rem; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.wuxing-title .icon { font-size: 2rem; }
.wuxing-detail { font-size: 0.95rem; color: var(--color-text); opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease; max-height: 0; }
.wuxing-card:hover .wuxing-detail { opacity: 1; transform: translateY(0); max-height: 200px; }

/* Lookup Table Section */
.section-lookup { background-color: var(--color-background); padding: 64px 0; color: var(--color-text-light); }
.search-wrapper { max-width: 600px; margin: 0 auto 3rem; position: relative; }
.search-input { width: 100%; padding: 1.25rem 4rem 1.25rem 1.5rem; font-size: 1.1rem; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-background); color: var(--color-text-light); box-shadow: var(--shadow-glow); transition: all 0.3s ease; }
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px hsla(195, 85%, 55%, 0.3); }
.search-icon { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); color: var(--color-primary); }
.table-container { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); background-color: var(--color-background); }
.styled-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.styled-table th, .styled-table td { padding: 1.25rem; text-align: left; border-bottom: 1px solid var(--color-border); }
.styled-table thead th { background-color: var(--color-surface); color: var(--color-accent); font-family: var(--font-serif); font-size: 1rem; position: sticky; top: 0; z-index: 1; }
.styled-table tbody tr { transition: background-color 0.2s ease; }
.styled-table tbody tr:hover { background-color: var(--color-surface); }
.styled-table tbody td { color: var(--color-text); }
.styled-table .year-cell, .styled-table .menh-cell { font-weight: 700; color: var(--color-text-light); }
.highlight { background-color: hsl(45, 90%, 25%); color: hsl(45, 90%, 85%); border-radius: 4px; padding: 2px 4px; }

/* --- 5. RESPONSIVE --- */
@media (max-width: 1200px) {
    .wuxing-grid { grid-template-columns: repeat(3, 1fr); }
    /* Logic to span last 2 items if needed (can be removed if not desired) */
    .wuxing-grid a:nth-last-child(2):first-child,
    .wuxing-grid a:nth-last-child(1):nth-child(2) { grid-column: span 1.5; }
}
@media (max-width: 767px) {
    .section-title { font-size: 28px; }
    .tool-row { flex-direction: column; align-items: stretch; }
    .wuxing-grid { grid-template-columns: 1fr; }
    /* Reset span on mobile */
    .wuxing-grid a:nth-last-child(2):first-child,
    .wuxing-grid a:nth-last-child(1):nth-child(2) { grid-column: span 1; }
    .wuxing-card { height: 300px; }
    .styled-table th, .styled-table td { padding: 1rem; }
}