/* --- CỐ LẬP PHẠM VI TOOL --- */
#tuvi-pro-app {
    all: initial; /* Ngắt kế thừa từ theme WordPress */
    display: block;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    background-color: transparent;
}

#tuvi-pro-app * { box-sizing: border-box; }
/* ÉP TÂM LA BÀN VÀO ĐÚNG VỊ TRÍ TRUNG TÂM */

#tuvi-pro-app .tv-compass-circle {
    position: relative !important;
    width: 400px !important;
    height: 400px !important;
    margin: 50px auto !important;
    background: #fffcf5 !important;
    border: 4px solid #831010 !important;
    border-radius: 50% !important;
    overflow: visible !important; /* Để hiện tooltip thoát ra ngoài */
    display: block !important;
}

#tuvi-pro-app .tuvi-center-info {
    /* Sử dụng tọa độ cứng thay vì chỉ dùng % để tránh lệch tâm trên các trình duyệt khác nhau */
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 140px !important;
    height: 140px !important;
    /* Dịch chuyển ngược lại đúng bằng 1/2 kích thước bản thân để vào tâm tuyệt đối */
    margin-top: -70px !important; 
    margin-left: -70px !important;
    
    background: white !important;
    border: 4px solid #831010 !important;
    border-radius: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    z-index: 5 !important;
    box-sizing: border-box !important;
}

/* Đảm bảo các nút số xung quanh cũng căn từ tâm chuẩn */
#tuvi-pro-app .tv-number-node {
    position: absolute !important;
    width: 42px !important;
    height: 42px !important;
    margin-top: -21px !important; /* 1/2 chiều cao nút số */
    margin-left: -21px !important; /* 1/2 chiều rộng nút số */
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}
/* FIX TÂM LA BÀN & TOOLTIP */
#tuvi-pro-app .tv-compass-circle {
    position: relative !important;
    width: 400px !important;
    height: 400px !important;
    margin: 50px auto !important;
    border: 4px solid #831010 !important;
    border-radius: 50% !important;
    overflow: visible !important; /* Quan trọng để hiện tooltip */
    background: #fffcf5 !important;
}

#tuvi-pro-app .tuvi-center-info {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 140px !important;
    height: 140px !important;
    margin-top: -70px !important; /* Một nửa chiều cao */
    margin-left: -70px !important; /* Một nửa chiều rộng */
    background: white !important;
    border: 4px solid #831010 !important;
    border-radius: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
}

#tuvi-pro-app .tv-tooltip {
    visibility: hidden; opacity: 0; position: absolute;
    bottom: 130%; left: 50%; transform: translateX(-50%);
    width: 220px; background: rgba(0,0,0,0.9); color: #fff;
    padding: 12px; border-radius: 12px; z-index: 2000 !important;
    transition: 0.3s; text-align: center;
}
#tuvi-pro-app .tv-number-node:hover .tv-tooltip { visibility: visible; opacity: 1; }

/* GRID HỆ THỐNG CỦA TOOL */
#tuvi-pro-app .tv-row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
#tuvi-pro-app .tv-col-6 { width: 50%; padding: 10px; }
#tuvi-pro-app .tv-col-4 { width: 33.33%; padding: 10px; }
#tuvi-pro-app .tv-col-12 { width: 100%; padding: 10px; }

@media (max-width: 768px) { #tuvi-pro-app .tv-col-6, #tuvi-pro-app .tv-col-4 { width: 100%; } }
/* LAYOUT CHÍNH */
.tv-container { width: 100%; max-width: 1536px; margin: 0 auto; padding: 20px; }

.tv-main-card {
    background-color: #fdfbf7;
    border: 8px solid #831010;
    border-radius: 40px;
    padding: 40px;
    max-width: 1100px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.tv-main-title {
    text-align: center;
    color: #831010;
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

/* HỆ THỐNG LƯỚI NHẬP LIỆU */
.tv-input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.tv-input-group {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.tv-border-red { border-top: 5px solid #831010; }
.tv-border-blue { border-top: 5px solid #0d6efd; }

.tv-group-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; margin-bottom: 20px; }
.tv-text-red { color: #831010; }
.tv-text-blue { color: #0d6efd; }

.tv-input-field {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #eee;
    background-color: #f8f9fa;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.tv-flex-row { display: flex; gap: 10px; }
.tv-gender-selection { display: flex; gap: 20px; justify-content: center; margin: 10px 0; font-weight: 700; }
.tv-select-highlight { background-color: #fff3e0; color: #e65100; border: none; }

/* NÚT BẤM */
.tv-btn-primary {
    width: 100%;
    padding: 20px;
    border-radius: 20px;
    background-color: #831010;
    color: white;
    font-weight: 900;
    font-size: 1.25rem;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.tv-btn-primary:hover { background-color: #000; transform: translateY(-2px); }

/* LA BÀN & KẾT QUẢ */
.tv-compass-wheel {
    width: 400px;
    height: 400px;
    border: 4px solid #831010;
    border-radius: 50%;
    margin: 50px auto;
    position: relative;
    background: #fffcf5;
    overflow: visible !important; /* QUAN TRỌNG: Để hiện tooltip */
}

.tv-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.tv-capture-container {
    padding: 40px;
    background: white;
    border-radius: 30px;
}

/* TOOLTIP & NODE SỐ */
.tv-number-node {
    position: absolute !important;
    transform: translate(-50%, -50%) !important;
    width: 42px; height: 42px;
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; z-index: 10;
}

.tv-tooltip {
    visibility: hidden; opacity: 0;
    position: absolute; bottom: 130%; left: 50%;
    transform: translateX(-50%);
    width: 200px; background: #000; color: #fff;
    padding: 10px; border-radius: 10px; z-index: 100;
    text-align: center; transition: 0.3s;
}

.tv-number-node:hover .tv-tooltip { visibility: visible; opacity: 1; }

@media (max-width: 768px) {
    .tv-analysis-grid { grid-template-columns: 1fr; }
    .tv-compass-wheel { transform: scale(0.8); margin: 0 auto; }
}
/* ÉP CHIA 2 CỘT CHO 12 CUNG */
#tuvi-pro-app #interpretation.tv-row {
    display: flex !important;
    flex-wrap: wrap !important; /* Cho phép các cột tự động nhảy sang hàng mới */
    margin: 0 -10px !important;
    width: auto !important;
}

#tuvi-pro-app .tv-col-6 {
    width: 50% !important; /* Ép đúng 1/2 chiều rộng container */
    padding: 10px !important;
    box-sizing: border-box !important; /* Đảm bảo padding không làm phình cột */
}

/* Điều chỉnh cho mobile (Nếu cần) */
@media (max-width: 768px) {
    #tuvi-pro-app .tv-col-6 {
        width: 100% !important; /* Về 1 cột trên điện thoại */
    }
}
/* TỐI ƯU HIỂN THỊ 1 CỘT FULL WIDTH */
#tuvi-pro-app .tv-col-12 {
    width: 100% !important;
    padding: 10px !important;
    display: block !important;
}

#tuvi-pro-app .tv-card {
    margin-bottom: 10px !important; /* Giảm khoảng cách giữa các cung cho gọn */
}

/* Đảm bảo chữ trong tâm la bàn không bị tràn */
.tuvi-center-info small {
    display: block !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
}