/* Background chung */
        body {
            background: #f5f5f5 !important;
        }

        .container-ve {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
            margin-top: 20px;
        }

        /* Card steps với viền */
        .step-card {
            background: white;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
        }

        .step-title {
            font-size: 18px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #f3f4f6;
        }

        .tab-button {
            padding: 8px 12px;
            /* Giảm padding xuống */
            border: 1px solid #d1d5db !important;
            /* Giảm border từ 2px xuống 1px */
            background: white !important;
            cursor: pointer;
            transition: all 0.3s;
            border-radius: 6px;
            /* Giảm border-radius */
            font-weight: 500;
            color: #6b7280 !important;
            white-space: nowrap;
            flex-shrink: 0;
            font-size: 14px;
            /* Giảm font size */
        }

        .tab-button:hover {
            background: #f9fafb !important;
            border-color: #9ca3af !important;
            color: #374151 !important;
        }

        .tab-button.active {
            background: #7c3aed !important;
            color: white !important;
            border: 1px solid #7c3aed !important;
            font-weight: 600;
        }

        /* Responsive cho tab buttons - luôn 1 hàng trên mọi màn hình */
        @media (max-width: 768px) {
            .tab-button {
                padding: 6px 10px;
                font-size: 12px;
            }
        }

        @media (max-width: 480px) {
            .tab-button {
                padding: 5px 8px;
                font-size: 11px;
            }
        }

        .tab-content-panel {
            display: none !important;
        }

        .tab-content-panel.active {
            display: block !important;
        }

        .direction-card {
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            padding: 8px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .direction-card:hover {
            border-color: #9ca3af;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .direction-card.selected {
            border-color: #7c3aed;
            background: #f5f3ff;
            border-width: 2px;
        }

        /* Form controls */
        .form-control,
        .form-control-sm {
            border: 1px solid #d1d5db;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .form-control:focus,
        .form-control-sm:focus {
            border-color: #7c3aed;
            box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
        }

        .direction-icon {
            font-size: 32px;
            margin-bottom: 4px;
        }

        .direction-card .font-weight-bold {
            font-size: 14px;
        }

        .direction-card .small {
            font-size: 11px !important;
        }

        /* Inline direction cards (1 row) */
        .direction-card-inline {
            border: 2px solid #e5e7eb;
            border-radius: 6px;
            padding: 6px 10px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            min-width: 80px;
        }

        .direction-card-inline:hover {
            border-color: #000000;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .direction-card-inline.selected {
            border-color: #000000;
            background: #e5e7eb;
            border-width: 2px;
        }

        /* Mobile: 8 direction buttons thành 2 hàng, mỗi hàng 4 buttons */
        @media (max-width: 768px) {
            .direction-card-inline {
                flex: 0 0 calc(25% - 8px) !important;
                /* 4 buttons mỗi hàng (25% - gap) */
                min-width: calc(25% - 8px) !important;
                max-width: calc(25% - 8px) !important;
                margin-bottom: 8px;
                padding: 4px 6px;
                font-size: 12px;
            }

            .direction-icon-small {
                font-size: 20px;
            }

            .direction-name-small {
                font-size: 11px;
            }
        }

        .direction-icon-small {
            font-size: 24px;
            margin-bottom: 2px;
        }

        .direction-name-small {
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 1px;
        }

        .direction-degree-small {
            font-size: 10px;
            color: #6b7280;
        }

        /* Style cho 9 khu vực trong luận giải */
        .luan-giai-container {
            max-width: 1000px;
            margin: 0 auto;
        }

        .khu-vuc-section {
            background: #f9fafb;
            border-left: 4px solid #000000 !important;
            margin-bottom: 20px;
        }

        .khu-vuc-title {
            color: #000000;
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
        }

        .khu-vuc-content {
            color: #374151;
            line-height: 1.8;
            font-size: 0.95rem;
        }

        .hk-nam-box {
            background-color: #fffbeb !important;
            border: 1px solid #f3e3b0 !important;
            color: #3f2f1a !important;
        }

        .hk-nam-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: #92400e !important;
        }

        .khu-vuc-section:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            transform: translateY(-2px);
            transition: all 0.3s;
        }

        /* Sub-tabs cho Luận Tổng Quát (9 khu vực) */
        .sub-tab {
            font-size: 0.9rem;
            padding: 6px 12px;
            border-radius: 6px;
            transition: all 0.3s;
            border: 1px solid #e5e7eb !important;
            background: #fafafa !important;
            color: #6b7280 !important;
            margin: 2px;
            font-weight: 400;
        }

        .sub-tab:hover {
            border-color: #d1d5db !important;
            color: #374151 !important;
            background: #f3f4f6 !important;
        }

        .sub-tab.active {
            background: #e5e7eb !important;
            color: #000000 !important;
            border: 1px solid #6b7280 !important;
            font-weight: 600;
        }

        /* Background color và border cho tất cả các ô nhập liệu */
        input[type="text"],
        input[type="email"],
        input[type="number"],
        input[type="date"],
        select {
            background-color: rgb(248, 248, 248) !important;
            border: 1px solid rgb(170, 170, 170) !important;
        }

        /* Style cho nav-tabs buttons - Loại bỏ TẤT CẢ viền Bootstrap */
        .nav-tabs,
        .nav-tabs.nav-justified,
        ul.nav-tabs {
            gap: 10px !important;
            border: none !important;
            border-top: none !important;
            border-right: none !important;
            border-bottom: none !important;
            border-left: none !important;
            box-shadow: none !important;
            outline: none !important;
            display: flex !important;
            /* Thay thế display: table của Bootstrap */
            flex-wrap: wrap !important;
            justify-content: center !important;
        }

        .nav-tabs.nav-justified .nav-item {
            border: none !important;
            display: inline-block !important;
            /* Override table-cell của Bootstrap */
            flex: 0 0 auto !important;
            /* Không stretch */
        }

        .nav-tabs.nav-justified .nav-item::before,
        .nav-tabs.nav-justified .nav-item::after {
            display: none !important;
        }

        .nav-tabs.nav-justified .nav-link {
            border-bottom: 2px solid #d1d5db !important;
            /* Chỉ có border riêng của từng button */
        }

        .nav-tabs .nav-item {
            margin: 0 5px !important;
            border: none !important;
            /* Loại bỏ viền của nav-item */
        }

        .nav-tabs .nav-item::before,
        .nav-tabs .nav-item::after {
            display: none !important;
        }

        .nav-tabs::before,
        .nav-tabs::after {
            display: none !important;
            /* Loại bỏ pseudo elements có thể tạo viền */
        }

        .nav-tabs .nav-link {
            background-color: #f3f4f6 !important;
            color: #374151 !important;
            border: 2px solid #d1d5db !important;
            border-radius: 8px !important;
            /* Bo góc cho đẹp */
            font-weight: 500;
            margin: 0 !important;
            margin-bottom: 0 !important;
            /* Loại bỏ margin-bottom của Bootstrap */
            padding: 8px 10px !important;
            /* Giảm padding 2 bên */
            white-space: nowrap;
        }

        .nav-tabs .nav-link:hover {
            background-color: #e5e7eb !important;
            color: #000000 !important;
            border: 2px solid #9ca3af !important;
            /* Đảm bảo border đầy đủ khi hover */
        }

        .nav-tabs .nav-link.active-tab,
        .nav-tabs .nav-link.active,
        .tab-common.active-tab {
            background-color: #7c3aed !important;
            color: white !important;
            border: 2px solid #7c3aed !important;
            font-weight: 600 !important;
            margin-bottom: 0 !important;
        }

        /* Loại bỏ border bottom của Bootstrap cho nav-tabs */
        .nav-tabs .nav-link:not(.active):not(.active-tab) {
            border-bottom: 2px solid #d1d5db !important;
        }

        /* ============================================
           4 BUTTONS "BÁT TRẠCH, MỞ CỬA, TỌA SƠN, PHỤ TINH"
           - Desktop (>768px): 1 hàng, 4 buttons
           - Mobile (≤768px): 2 hàng, mỗi hàng 2 buttons
           ============================================ */

        /* Desktop: 4 buttons trên 1 hàng */
        .nav-tabs.nav-justified {
            flex-wrap: nowrap !important;
        }

        .nav-tabs.nav-justified .nav-item {
            flex: 1 1 auto !important;
            margin-bottom: 8px !important;
        }

        /* Mobile: 2 hàng, mỗi hàng 2 buttons */
        @media (max-width: 768px) {
            .nav-tabs.nav-justified {
                flex-wrap: wrap !important;
            }

            .nav-tabs.nav-justified .nav-item {
                flex: 0 0 48% !important;
                max-width: 48% !important;
            }

            .nav-tabs .nav-link {
                padding: 8px 6px !important;
                font-size: 13px;
            }
        }

        /* Style cho nav-pills buttons (sub-tabs 8-9 hướng) */
        .nav-pills .nav-link {
            background-color: #fafafa !important;
            color: #6b7280 !important;
            border: 1px solid #e5e7eb !important;
            font-weight: 400;
            padding: 8px 10px !important;
            /* Giảm padding 2 bên */
            margin: 2px;
            transition: all 0.2s ease;
            white-space: nowrap;
            width: 100% !important;
            /* Chiếm toàn bộ width của nav-item */
            display: block !important;
            text-align: center !important;
        }

        .nav-pills .nav-link:hover {
            background-color: #f3f4f6 !important;
            color: #374151 !important;
            border-color: #d1d5db !important;
        }

        .nav-pills .nav-link.active,
        .nav-pills .sub-tab.active {
            background-color: #7c3aed !important;
            color: white !important;
            border: 1px solid #7c3aed !important;
            font-weight: 600;
        }

        /* Responsive cho nav-pills - Sub-tabs thành 2 hàng trên mobile */
        @media (max-width: 768px) {

            /* Tab Tổng Quát: 9 buttons (5 buttons hàng 1, 4 buttons hàng 2) */
            #sub_tabs_tong_quat .nav-pills.nav-fill {
                display: flex !important;
                flex-wrap: wrap !important;
                justify-content: flex-start !important;
            }

            #sub_tabs_tong_quat .nav-pills.nav-fill .nav-item {
                flex: 0 0 calc(20% - 4px) !important;
                /* 5 buttons mỗi hàng */
                max-width: calc(20% - 4px) !important;
                margin: 2px !important;
            }

            /* 3 tabs còn lại: 8 buttons (4 buttons mỗi hàng) */
            #sub_tabs_mon_lau .nav-pills.nav-fill,
            #sub_tabs_toa_son .nav-pills.nav-fill,
            #sub_tabs_phu_tinh .nav-pills.nav-fill {
                display: flex !important;
                flex-wrap: wrap !important;
            }

            #sub_tabs_mon_lau .nav-pills.nav-fill .nav-item,
            #sub_tabs_toa_son .nav-pills.nav-fill .nav-item,
            #sub_tabs_phu_tinh .nav-pills.nav-fill .nav-item {
                flex: 0 0 calc(25% - 4px) !important;
                /* 4 buttons mỗi hàng */
                max-width: calc(25% - 4px) !important;
                margin: 2px !important;
            }

            .nav-pills .nav-link {
                padding: 6px 4px !important;
                font-size: 11px !important;
            }
        }

        #sub_tabs_tong_quat .nav-pills,
        #sub_tabs_mon_lau .nav-pills,
        #sub_tabs_toa_son .nav-pills,
        #sub_tabs_phu_tinh .nav-pills {
            gap: 8px;
            display: flex !important;
            flex-wrap: wrap !important;
        }

        #sub_tabs_tong_quat .nav-item,
        #sub_tabs_mon_lau .nav-item,
        #sub_tabs_toa_son .nav-item,
        #sub_tabs_phu_tinh .nav-item {
            margin: 0;
            flex: 1 1 auto !important;
            /* Các button chia đều không gian */
            min-width: 0 !important;
            /* Cho phép button co lại nếu cần */
        }

        /* Hide La Kinh action buttons in Basic tab ONLY */
        #tab-basic #an_la_kinh,
        #tab-basic #an_tam_hop,
        #tab-basic button[onclick*="anDaiQuai"],
        #tab-basic button[onclick*="anHKPT"],
        #tab-basic button[onclick*="selectKyMonDaiQuai"],
        #tab-basic #an_ky_mon_dai_quai {
            display: none !important;
        }

        /* Advanced slider card - Always visible in Advanced tab */
        #advanced_slider_card {
            display: block !important;
        }

        /* Fix duplicate slider rendering */
        #advanced_slider_card .slider.slider-horizontal {
            margin-bottom: 20px !important;
        }

        /* Proper spacing for slider labels */
        #advanced_slider_card .slider-wrapper {
            position: relative;
            padding-bottom: 35px;
            /* Space for tick labels */
            margin-bottom: 10px;
        }

        #advanced_slider_card .slider-tick-label-container {
            margin-top: 8px;
        }

        /* Hide any duplicate slider elements that might be created */
        #huong_la_kinh_advanced>.slider.slider-horizontal+.slider.slider-horizontal {
            display: none !important;
        }

        /* Keep ALL buttons visible in Advanced tab */
        #tab-advanced #an_la_kinh,
        #tab-advanced #an_tam_hop,
        #tab-advanced button[onclick*="anDaiQuai"],
        #tab-advanced button[onclick*="anHKPT"],
        #tab-advanced button[onclick*="selectKyMonDaiQuai"],
        #tab-advanced #an_ky_mon_dai_quai,
        #tab-advanced button[onclick*="downloadImage"],
        #tab-advanced button[onclick*="downloadTransparentPNG"],
        #tab-advanced button[onclick="getLuanGiai()"] {
            display: inline-block !important;
        }

        /* Keep Download and Luận Giải visible in Basic tab */
        #tab-basic button[onclick*="downloadImage"],
        #tab-basic button[onclick*="downloadTransparentPNG"],
        #tab-basic button[onclick="getLuanGiai()"] {
            display: inline-block !important;
        }

        /* Hide THỜI VẬN and THÔNG TIN CÔNG TRÌNH in Basic tab ONLY */
        #tab-basic .phong-thuy-title:contains("THỜI VẬN"),
        #tab-basic .phong-thuy-title:contains("THÔNG TIN CÔNG TRÌNH"),
        #tab-basic p.phong-thuy-title {
            display: none !important;
        }

        /* Animation cho nút khi cần chú ý */
        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
            }

            50% {
                box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
            }
        }

        .btn-pulse {
            animation: pulse 1s infinite;
        }

        /* Custom button styles - Trắng mặc định, Tím khi active */
        .btn-custom {
            background-color: white !important;
            border: 1px solid #d1d5db !important;
            color: #6b7280 !important;
            transition: all 0.2s ease;
            padding: 8px 12px;
            /* Giảm padding 2 bên */
            border-radius: 6px;
            white-space: nowrap;
        }

        .btn-custom:hover {
            background-color: #f9fafb !important;
            border-color: #9ca3af !important;
            color: #374151 !important;
        }

        .btn-custom.active,
        .btn-custom:active {
            background-color: #7c3aed !important;
            border-color: #7c3aed !important;
            color: white !important;
            box-shadow: 0 2px 4px rgba(124, 58, 237, 0.15) !important;
        }

        /* Action buttons - luôn 1 hàng */
        #action-buttons {
            display: flex !important;
            justify-content: center !important;
            align-items: center !important;
            flex-wrap: nowrap !important;
            gap: 8px !important;
        }

        @media (max-width: 768px) {
            .btn-custom {
                padding: 6px 10px;
                font-size: 13px;
            }
        }

.year-link {
                        display: block;
                        padding: 12px 15px;
                        margin-bottom: 10px;
                        background: #f3f4f6;
                        color: #000000;
                        border: 2px solid #d1d5db;
                        border-radius: 8px;
                        text-decoration: none;
                        transition: all 0.3s ease;
                        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
                        font-weight: 500;
                    }

                    .year-link:hover {
                        transform: translateY(-2px);
                        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
                        color: #000000;
                        background: #e5e7eb;
                        border-color: #000000;
                        text-decoration: none;
                    }

                    .gender-section {
                        margin-bottom: 20px;
                    }

.hover-shadow {
                    transition: box-shadow 0.2s ease;
                }

                .hover-shadow:hover {
                    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
                }

                .decade-card {
                    transition: all 0.2s ease;
                }

                .decade-card:hover {
                    background: #f8f9fa;
                    border-color: #000000 !important;
                }

@keyframes markerPulse {

        0%,
        100% {
            transform: scale(1);
            opacity: 1;
        }

        50% {
            transform: scale(1.2);
            opacity: 0.7;
        }
    }

    @keyframes markerRipple {
        0% {
            transform: scale(0.8);
            opacity: 1;
        }

        100% {
            transform: scale(1.8);
            opacity: 0;
        }
    }
