/* ==========================================
   FILE: style.css
   MÔ TẢ: Giao diện Tử Vi Cổ Điển - Sang Trọng (Phong thủy cao cấp)
   ========================================== */

/* --- IMPORT PHÔNG CHỮ --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=Playfair+Display:wght@600;700&family=Roboto:wght@400;500;700&display=swap');

/* --- 1. BIẾN MÔI TRƯỜNG (CSS VARIABLES) --- */
:root {
    /* Bảng màu nền cổ điển */
    --bg-giay-do: #f4ebd8;       /* Vàng nhạt giấy dó */
    --bg-trang-nga: #fffdf7;     /* Trắng ngà cho các thẻ */
    
    /* Bảng màu viền & nhấn */
    --border-nau: #5c4033;       /* Nâu sậm gỗ */
    --gold-accent: #b8860b;      /* Vàng đồng tối */
    --gold-light: #d4af37;       /* Vàng đồng sáng */
    
    /* Bảng màu văn bản & Sao */
    --text-main: #332211;        /* Nâu đen mượt */
    --sao-chinh: #000000;        /* Đen tuyền huyền bí */
    --sao-cat: #0f5132;          /* Cát tinh: Xanh lục thẫm */
    --sao-hung: #8b0000;         /* Hung tinh: Đỏ huyết dụ */
    
    /* Typography */
    --font-ui: 'Roboto', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --font-tuvi: 'Merriweather', serif;
}

/* --- 2. RESET & BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-giay-do);
    /* Pattern hoa văn chìm nhẹ (tùy chọn) */
    background-image: radial-gradient(#e6d5b8 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- 3. FORM NHẬP LIỆU (THIẾT KẾ SANG TRỌNG) --- */
.input-section {
    background: var(--bg-trang-nga);
    border: 2px solid var(--gold-accent);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(92, 64, 51, 0.1);
    position: relative;
}

/* Viền trang trí góc Form */
.input-section::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid rgba(184, 134, 11, 0.3);
    pointer-events: none;
}

.app-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 32px;
    color: var(--border-nau);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.form-group label {
    font-family: var(--font-tuvi);
    font-size: 14px;
    font-weight: 700;
    color: var(--border-nau);
    margin-bottom: 6px;
}

input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid var(--border-nau);
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-bottom-color: var(--gold-light);
}

.radio-wrapper {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    font-family: var(--font-tuvi);
}

.btn-submit {
    background-color: var(--border-nau);
    color: var(--bg-giay-do);
    border: 2px solid var(--gold-accent);
    padding: 14px 24px;
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    background-color: var(--text-main);
    color: #fff;
    box-shadow: 0 0 15px var(--gold-light);
}

/* --- 4. BẢN ĐỒ LÁ SỐ (LƯỚI 12 CUNG CỔ ĐIỂN) --- */
.chart-section {
    display: flex;
    justify-content: center;
    width: 100%;
}

.laso-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    grid-template-rows: repeat(4, minmax(180px, 1fr));
    /* Viền đôi (double) đúng chuẩn phong thủy */
    border: 6px double var(--border-nau);
    background-color: var(--border-nau); /* Màu khe giữa các cung */
    gap: 2px;
    width: 100%;
    max-width: 1100px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Định vị 12 Cung (Giữ nguyên cấu trúc ma trận) */
.cung-ti { grid-column: 1 / 2; grid-row: 1 / 2; }
.cung-ngo { grid-column: 2 / 3; grid-row: 1 / 2; }
.cung-mui { grid-column: 3 / 4; grid-row: 1 / 2; }
.cung-than { grid-column: 4 / 5; grid-row: 1 / 2; }
.cung-thin { grid-column: 1 / 2; grid-row: 2 / 3; }
.cung-dau { grid-column: 4 / 5; grid-row: 2 / 3; }
.cung-mao { grid-column: 1 / 2; grid-row: 3 / 4; }
.cung-tuat { grid-column: 4 / 5; grid-row: 3 / 4; }
.cung-dan { grid-column: 1 / 2; grid-row: 4 / 5; }
.cung-suu { grid-column: 2 / 3; grid-row: 4 / 5; }
.cung-ty { grid-column: 3 / 4; grid-row: 4 / 5; }
.cung-hoi { grid-column: 4 / 5; grid-row: 4 / 5; }

/* THIÊN BÀN (TRUNG TÂM) */
.thien-ban {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    background-color: var(--bg-giay-do);
    background-image: radial-gradient(#e6d5b8 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px solid var(--border-nau);
}

.thien-ban-content h2 {
    font-family: var(--font-heading);
    font-size: 36px;
    color: var(--border-nau);
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--gold-accent);
    padding-bottom: 10px;
}

.thong-tin-menh p {
    font-family: var(--font-tuvi);
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-main);
}
.thong-tin-menh strong {
    color: var(--border-nau);
}

/* CHI TIẾT BÊN TRONG 1 CUNG */
.cung-box {
    background-color: var(--bg-trang-nga);
    position: relative;
    padding: 35px 12px 25px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Hiệu ứng hover nổi viền vàng */
.cung-box:hover {
    box-shadow: inset 0 0 20px rgba(184, 134, 11, 0.4);
    background-color: #ffffff;
}

/* Tên cung & Tên chi (Góc) */
.cung-name, .cung-chi {
    position: absolute;
    font-family: var(--font-tuvi);
    font-weight: 700;
    font-size: 14px;
    color: var(--border-nau);
}

.cung-name { top: 8px; left: 10px; }
.cung-chi { bottom: 8px; right: 10px; }

/* Tràng sinh */
.trang-sinh {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-style: italic;
    color: #666;
}

/* Chính Tinh */
.chinh-tinh {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dac-tinh-m, .dac-tinh-v, .dac-tinh-d { color: var(--sao-chinh); }
.dac-tinh-h { color: var(--sao-hung); }

/* Phụ Tinh (Chia 2 cột sắc nét) */
.phu-tinh-container {
    display: flex;
    width: 100%;
    justify-content: space-between;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.7;
    font-weight: 500;
}

.phu-tinh-tot {
    text-align: left;
    color: var(--sao-cat);
    width: 48%;
}

.phu-tinh-xau {
    text-align: right;
    color: var(--sao-hung);
    width: 48%;
}

/* --- 5. TABS LUẬN GIẢI SANG TRỌNG --- */
.tabs-section {
    margin-top: 10px;
}

.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    background: transparent;
    border: 1px solid var(--border-nau);
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--border-nau);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.tab-btn:hover {
    background-color: rgba(92, 64, 51, 0.05);
}

.tab-btn.active {
    background-color: var(--border-nau);
    color: var(--bg-giay-do);
    border-color: var(--border-nau);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.tab-content-container {
    background: var(--bg-trang-nga);
    border: 1px solid var(--gold-accent);
    padding: 35px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.8;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active { display: block; }

.tab-pane h3 {
    font-family: var(--font-heading);
    color: var(--border-nau);
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.3);
    padding-bottom: 10px;
}

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

/* --- 6. RESPONSIVE (MOBILE) --- */
@media (max-width: 850px) {
    .laso-grid {
        display: flex;
        flex-direction: column;
        border: none;
        background: transparent;
        box-shadow: none;
        gap: 15px;
    }

    .thien-ban {
        order: -1;
        border: 2px solid var(--gold-accent);
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .cung-box {
        border: 1px solid var(--border-nau);
        border-radius: 8px;
        min-height: 160px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
}
