/* =========================================
   1. RESET & CẤU HÌNH CƠ BẢN
   ========================================= */
   * { box-sizing: border-box; }
   body {
       margin: 0; padding: 0;
       font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
       background: #f8fafc;
       color: #1e293b;
       /* Mobile padding để tránh bị thanh menu che */
       padding-bottom: 80px; 
   }
   @media (min-width: 769px) { body { padding-bottom: 0; } }
   
   button { cursor: pointer; transition: all 0.2s; font-family: inherit; }
   
   /* =========================================
      2. HEADER & ACCOUNT AREA (Nút Login, VIP)
      ========================================= */
   /* Mặc định Desktop: Nằm góc trên phải */
   #account-area {
       position: absolute; top: 20px; right: 20px; z-index: 1000;
       display: flex; align-items: center; gap: 10px;
   }
   .nav-actions { display: flex; gap: 10px; }
   
   /* Style nút VIP & Hướng dẫn */
   .btn-guide, .btn-upgrade {
       border: none; outline: none; padding: 8px 20px;
       border-radius: 50px; font-size: 14px; font-weight: 600;
       display: flex; align-items: center; gap: 6px;
       box-shadow: 0 2px 8px rgba(0,0,0,0.1);
   }
   .btn-upgrade { background: linear-gradient(135deg, #ffd700, #ffae00); color: #5d4037; }
   .btn-guide { background: white; color: #636e72; border: 1px solid #e0e0e0; }
   
   /* Mobile: Chuyển xuống đáy màn hình */
   @media (max-width: 768px) {
       #account-area {
           position: fixed !important; top: auto !important; bottom: 0; left: 0; width: 100%;
           background: white; padding: 10px 0;
           box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
           justify-content: center; z-index: 9000;
       }
       .nav-actions { width: 100%; justify-content: space-around; padding: 0 15px; }
       .btn-guide, .btn-upgrade { flex: 1; justify-content: center; height: 40px; }
       
       /* Thông tin User chuyển lên góc phải trên Mobile */
       #user-logged-in {
           position: fixed !important; top: 15px; right: 15px;
           background: white; padding: 5px 12px; border-radius: 20px;
           box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 9001;
       }
   }
   
   /* =========================================
      3. LAYOUT CHÍNH (Sidebar + Main Content)
      ========================================= */
   .dashboard-wrapper {
       display: flex; min-height: 100vh;
   }
   
   /* Sidebar Menu Trái */
   .sidebar {
       width: 280px; background: white; border-right: 1px solid #e2e8f0;
       padding: 30px 20px; display: flex; flex-direction: column;
       position: sticky; top: 0; height: 100vh; overflow-y: auto;
   }
   .app-brand { font-size: 24px; font-weight: 800; color: #2563eb; margin-bottom: 30px; }
   
   /* Main Content Phải */
   .main-content {
       flex: 1; padding: 30px; width: 100%;
       /* Đẩy xuống một chút trên mobile để tránh bị Header che */
   }
   
   /* Menu Mobile (Off-canvas) */
   .mobile-menu-toggle { display: none; }
   .menu-overlay { display: none; }
   
   @media (max-width: 768px) {
       .dashboard-wrapper { display: block; }
       
       /* Nút mở menu */
       .mobile-menu-toggle {
           display: block; width: fit-content;
           background: #2563eb; color: white; padding: 8px 15px;
           border-radius: 8px; margin-bottom: 20px; font-weight: bold;
       }
   
       /* Sidebar ẩn đi */
       .sidebar {
           position: fixed; top: 0; left: -100%; width: 80%; max-width: 300px;
           z-index: 9999; transition: 0.3s;
           box-shadow: 5px 0 20px rgba(0,0,0,0.1);
       }
       .sidebar.active { left: 0; }
       
       .menu-overlay.active {
           display: block; position: fixed; top: 0; left: 0;
           width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9998;
       }
       
       .main-content { padding: 20px 15px; padding-top: 70px; }
   }
   
   /* =========================================
      4. CHAT LIVE SCREEN (Giao diện Chat)
      ========================================= */
   #chat-live-screen {
       position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
       background: white; z-index: 9999;
       display: none; /* Mặc định ẩn */
   }
   
   /* DESKTOP: Chia 2 cột */
   @media (min-width: 769px) {
       #chat-live-screen { display: flex; } /* Khi bật lên sẽ là flex */
       
       .sidebar-status {
           width: 280px; background: #f9fafb; border-right: 1px solid #eee;
           padding: 20px; display: flex; flex-direction: column; gap: 20px;
       }
       
       .chat-interface {
           flex: 1; display: flex; flex-direction: column;
           padding: 0; height: 100%;
       }
       
       #chat-history {
           flex: 1; overflow-y: auto; padding: 20px;
           max-width: 900px; width: 100%; margin: 0 auto;
       }
       
       .mic-area {
           padding: 20px; background: white; border-top: 1px solid #eee;
           text-align: center;
       }
   }
   
   /* MOBILE: Dọc 1 cột */
   @media (max-width: 768px) {
       #chat-live-screen { flex-direction: column; }
       
       /* Ẩn Sidebar status trên mobile để rộng chỗ (Hoặc hiện dạng Header nhỏ) */
       .sidebar-status {
           padding: 10px; border-bottom: 1px solid #eee;
           display: flex; justify-content: space-between; align-items: center;
           background: white; height: auto; width: 100%;
       }
       /* Chỉnh lại các phần tử trong sidebar cho nằm ngang */
       .sidebar-status .sidebar-header { width: 100%; display: flex; justify-content: space-between; align-items: center; }
       #chat-scenario-box { display: none; } /* Ẩn cái hộp chủ đề cho gọn */
       
       .chat-interface {
           flex: 1; display: flex; flex-direction: column;
           width: 100%; overflow: hidden;
       }
       
       #chat-history {
           flex: 1; overflow-y: auto; padding: 15px;
           margin-bottom: 0; 
           padding-bottom: 20px;
       }
       
       /* Vùng Mic ghim đáy */
       .mic-area {
           flex: none; background: white; 
           padding: 15px 0 30px 0; /* Padding đáy dày tí cho iPhone */
           border-top: 1px solid #eee; text-align: center;
           z-index: 1000;
       }
   }
   
   /* Style cho các thành phần Chat */
   .status-badge.online { color: green; font-weight: bold; font-size: 14px; }
   .btn-end { background: #ef4444; color: white; border: none; padding: 8px 15px; border-radius: 6px; font-weight: bold; }
   .msg-ai { background: #f1f5f9; padding: 10px 15px; border-radius: 12px 12px 12px 0; max-width: 85%; margin-bottom: 10px; display: inline-block; }
   .msg-user { background: #dbeafe; padding: 10px 15px; border-radius: 12px 12px 0 12px; max-width: 85%; margin-bottom: 10px; margin-left: auto; display: block; text-align: right; }
   
   .mic-btn-styled {
       width: 65px; height: 65px; background: #2563eb; color: white;
       border-radius: 50%; display: inline-flex; justify-content: center; align-items: center;
       font-size: 28px; margin: 10px auto;
       box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
   }
   .mic-btn-styled:active { transform: scale(0.95); }
   
   /* =========================================
      5. CÁC MODAL & POPUP KHÁC
      ========================================= */
   .modal-overlay, .ai-modal-overlay, .popup-overlay {
       display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
       background: rgba(0,0,0,0.6); z-index: 9999;
       justify-content: center; align-items: center;
       backdrop-filter: blur(4px);
   }
   
   .modal-content, .ai-modal-box, .popup-box {
       background: white; width: 90%; max-width: 450px;
       padding: 25px; border-radius: 20px;
       box-shadow: 0 20px 50px rgba(0,0,0,0.2);
       animation: popIn 0.3s ease-out;
       max-height: 90vh; overflow-y: auto;
   }
   @keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
   
   /* Grid bài học */
   .card-grid {
       display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
       gap: 20px; margin-top: 20px;
   }
   .lesson-card {
       background: white; border-radius: 16px; padding: 20px;
       box-shadow: 0 4px 10px rgba(0,0,0,0.03); border: 1px solid #f1f5f9;
   }
   
   /* Các nút chức năng AI */
   .ai-trigger-btn {
       width: 100%; background: #2563eb; color: white; padding: 12px;
       border-radius: 12px; border: none; font-weight: bold;
       display: flex; align-items: center; gap: 8px; justify-content: center;
   }
   .ai-icon-bounce { animation: bounce 2s infinite; }
   @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

   .ai-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65); /* Màu tối sang trọng */
    backdrop-filter: blur(5px); /* Làm mờ hậu cảnh */
    display: none; /* Mặc định ẩn, JS sẽ đổi thành flex */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

/* 2. Hộp thoại chính */
.ai-modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    position: relative;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Hiệu ứng nảy */
}

/* 3. Icon chat */
.ai-modal-icon {
    width: 60px; height: 60px;
    background-color: #eff6ff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 15px auto;
    border: 1px solid #dbeafe;
}

/* 4. Input nhập liệu */
.ai-modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f8fafc;
    margin-top: 5px;
}

.ai-modal-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 5. Nút bấm */
.ai-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.ai-btn:active { transform: scale(0.96); }

.ai-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}
.ai-btn-cancel:hover { background: #e2e8f0; color: #475569; }

.ai-btn-confirm {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}
.ai-btn-confirm:hover { opacity: 0.9; box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.4); }

/* Animation Keyframes */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 
    from { opacity: 0; transform: scale(0.8) translateY(20px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}

/* --- GIAO DIỆN CHAT LIVE MỚI (FIXED SIDEBAR) --- */



/* Phần nội dung chat chính (Đẩy sang phải) */
.live-chat-main {
    position: fixed;
    top: 0;
    left: 260px; /* Bằng width của sidebar */
    width: calc(100% - 260px);
    height: 100vh;
    background: #f8fafc;
    z-index: 9998;
    display: flex;
    flex-direction: column;
}

/* Header trong Sidebar */
.chat-logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.chat-status {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80; /* Màu xanh lá status */
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

/* Nút thoát ở Sidebar */
.btn-exit-chat {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-exit-chat:hover {
    background: #ef4444; /* Hover màu đỏ */
    border-color: #ef4444;
}

/* Khu vực cuộn tin nhắn */
.chat-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    scroll-behavior: smooth;
}

/* Khu vực Mic điều khiển ở dưới */
.chat-controls {
    background: white;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mic-big-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s;
    font-size: 28px;
    color: white;
}

.mic-big-btn:active {
    transform: scale(0.95);
}

.hint-text {
    margin-top: 15px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Responsive cho Mobile: Khi màn hình nhỏ, sidebar thu gọn lại */
@media (max-width: 768px) {
    .live-chat-sidebar {
        width: 70px; /* Thu nhỏ sidebar */
        padding: 20px 10px;
        align-items: center;
    }
    .chat-header span, .chat-logo, .btn-exit-chat span {
        display: none; /* Ẩn chữ */
    }
    .live-chat-main {
        left: 70px;
        width: calc(100% - 70px);
    }
}

/* === CSS CHO MÀN HÌNH CHAT === */

/* 1. Giao diện chung (Mặc định cho PC) */
.chat-screen-wrapper {
    flex-direction: column;
    height: calc(100vh - 40px); /* Cách trên dưới một chút cho thoáng trên PC */
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
}

/* Header của Chat */
.chat-header-mobile {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Khu vực lịch sử chat */
.chat-history-styled {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    background: #f1f5f9; /* Màu nền nhẹ cho vùng chat */
}

/* Khu vực Mic điều khiển */
.chat-mic-area {
    background: white;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

/* Nút thoát */
.btn-chat-exit {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}
.btn-chat-exit:hover {
    background: #fecaca;
}

/* Nút Mic to đẹp */
.mic-btn-styled {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s;
    color: white;
    font-size: 26px;
}
.mic-btn-styled:active {
    transform: scale(0.95);
}

.hint-link {
    margin-top: 15px;
    color: #2563eb;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
}

/* Hiệu ứng nhấp nháy Online */
.status-dot-blink {
    height: 10px; 
    width: 10px; 
    background: #22c55e; 
    border-radius: 50%; 
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: blinkUser 2s infinite;
}
@keyframes blinkUser {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* === QUAN TRỌNG: RESPONSIVE CHO MOBILE === */
@media (max-width: 768px) {
    .chat-screen-wrapper {
        /* Trên điện thoại: Bung full màn hình, đè lên tất cả */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh !important; /* Bắt buộc full chiều cao */
        border-radius: 0; /* Bỏ bo góc */
        border: none;
        z-index: 99999; /* Đè lên menu và nút toggle */
    }

    /* Ẩn nút Menu Toggle khi đang chat để đỡ rối */
    body.is-chatting .mobile-menu-toggle {
        display: none !important;
    }
}

/* =========================================
   VIP MODAL REDESIGN - FAZT ENGLISH STYLE
========================================= */

/* Nền mờ phía sau */
.modal-overlay {
    background: rgba(15, 23, 42, 0.6); /* Màu tối xanh hiện đại */
    backdrop-filter: blur(8px); /* Hiệu ứng mờ kính sang trọng */
    z-index: 10000; /* Đảm bảo luôn nằm trên cùng */
}

/* Hộp nội dung chính */
.vip-modal-content {
    max-width: 1100px !important; /* Rộng hơn để chứa 3 thẻ thoải mái */
    width: 95%;
    padding: 50px 40px !important;
    border-radius: 32px !important;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    position: relative;
    border: 1px solid #f1f5f9;
}

/* Nút đóng (X) */
.vip-close {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 36px;
    color: #94a3b8;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.vip-close:hover {
    color: #ef4444;
    background: #fef2f2;
    transform: rotate(90deg);
}

/* Header của Modal */
.vip-header {
    text-align: center;
    margin-bottom: 50px;
}
.vip-header .modal-title {
    font-size: 36px !important;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.vip-header .modal-subtitle {
    font-size: 18px;
    color: #64748b;
    font-weight: 500;
}

/* Container chứa 3 thẻ giá */
.pricing-container {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: stretch; /* Kéo dãn để các thẻ bằng nhau */
    flex-wrap: wrap;
}

/* --- Style Chung Cho Các Thẻ Giá --- */
.pricing-card {
    flex: 1;
    min-width: 300px; /* Chiều rộng tối thiểu */
    background: #fff;
    border-radius: 24px;
    padding: 35px 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

/* Hiệu ứng hover chung */
.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

/* Tên gói */
.pricing-card h3 {
    font-size: 22px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 20px;
}

/* Giá tiền */
.price {
    font-size: 42px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}
.price .period {
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
}

/* Đường kẻ chia cách */
.divider {
    height: 1px;
    background: #f1f5f9;
    margin: 25px 0;
}

/* Danh sách tính năng */
.features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
    flex-grow: 1; /* Đẩy nút mua xuống dưới cùng */
}
.features li {
    margin-bottom: 15px;
    color: #475569;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
}
/* Icon check màu xanh */
.features li i {
    color: #22c55e;
    font-size: 18px;
    margin-top: 2px;
}

/* Nút mua chung */
.btn-buy {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}
.btn-buy:active {
    transform: scale(0.98);
}

/* --- Style Riêng Cho Từng Gói --- */

/* 1. Gói Cơ bản (Trải nghiệm) */
.pricing-card.basic:hover {
    border-color: #94a3b8;
}
.btn-basic {
    background: #f1f5f9;
    color: #334155;
}
.btn-basic:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* 2. Gói Nổi bật (Tiết Kiệm) - QUAN TRỌNG NHẤT */
.pricing-card.featured {
    border: 3px solid #2563eb; /* Viền xanh nổi bật */
    background: linear-gradient(to bottom, #ffffff, #f8fbff); /* Gradient nhẹ */
    transform: scale(1.05); /* Phóng to hơn các thẻ khác */
    z-index: 2;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.2);
}
.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px); /* Giữ độ phóng to khi hover */
}
.pricing-card.featured h3 {
    color: #2563eb; /* Tên gói màu xanh */
}
.pricing-card.featured .price {
    color: #2563eb; /* Giá màu xanh */
}
.badge-best-seller {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.5);
}
.saving-label {
    display: inline-block;
    background: #dbeafe;
    color: #2563eb;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 10px;
}
.btn-featured {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
}
.btn-featured:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.6);
}

/* 3. Gói Trọn Đời (Lifetime) */
.pricing-card.lifetime {
    background: #0f172a; /* Nền tối sang trọng */
    border: 2px solid #334155;
}
.pricing-card.lifetime h3,
.pricing-card.lifetime .price,
.pricing-card.lifetime .features li {
    color: white !important; /* Chuyển chữ sang màu trắng */
}
.pricing-card.lifetime .period,
.pricing-card.lifetime .features li i {
    color: #94a3b8 !important; /* Màu xám nhạt cho icon và period */
}
.pricing-card.lifetime .divider {
    background: #334155;
}
.badge-lifetime {
    position: absolute;
    top: -15px;
    right: 30px;
    background: #334155;
    color: #e2e8f0;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #475569;
}
.btn-lifetime {
    background: #fff;
    color: #0f172a;
}
.btn-lifetime:hover {
    background: #e2e8f0;
}

/* --- Responsive cho Điện thoại --- */
@media (max-width: 992px) {
    .vip-modal-content {
        padding: 40px 25px !important;
        width: 90%;
        margin: 20px;
        max-height: 90vh;
        overflow-y: auto; /* Cho phép cuộn nếu màn hình quá bé */
    }
    .vip-header {
        margin-bottom: 30px;
    }
    .vip-header .modal-title {
        font-size: 28px !important;
    }
    .pricing-container {
        flex-direction: column; /* Xếp chồng lên nhau */
        align-items: center;
        gap: 35px;
    }
    .pricing-card {
        width: 100%;
        max-width: 400px;
        min-width: auto;
    }
    /* Reset hiệu ứng phóng to trên mobile */
    .pricing-card.featured {
        transform: scale(1); 
        order: -1; /* Đưa gói Bán chạy lên đầu tiên trên mobile */
    }
    .pricing-card.featured:hover {
        transform: translateY(-8px);
    }
}

/* =========================================
   PAYMENT MODAL REDESIGN
========================================= */

/* Khung modal chính */
.payment-box {
    max-width: 420px !important; /* Form hẹp giống hoá đơn */
    width: 95%;
    padding: 0 !important; /* Xóa padding mặc định để custom header */
    border-radius: 24px !important;
    background: #f8fafc;
    overflow: hidden; /* Để bo góc header không bị lòi ra */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3) !important;
    max-height: 90vh; /* Chỉ cao tối đa 90% màn hình để không bị lấp */
    display: flex;    /* Để chia bố cục Header và Body */
    flex-direction: column;
}

/* Nút đóng */
.payment-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    z-index: 10;
    transition: 0.2s;
}
.payment-close:hover {
    background: rgba(0,0,0,0.3);
    color: white;
}

/* Header Xanh đậm */
.payment-header-styled {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 40px 20px 30px;
    text-align: center;
    color: white;
    position: relative;
    border-radius: 0 0 50% 50% / 20px; /* Bo cong nhẹ phía dưới */
}

.bank-icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    backdrop-filter: blur(5px);
    font-size: 28px;
    border: 2px solid rgba(255,255,255,0.3);
}

.pay-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}
.pay-title span {
    font-weight: 800;
    color: #fff;
}

.pay-price-tag {
    font-size: 32px;
    font-weight: 900;
    margin-top: 5px;
    letter-spacing: -1px;
}

/* Body chứa nội dung */
.payment-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; /* Cho phép lăn chuột/vuốt tay nếu dài quá */
    flex: 1;          /* Tự động chiếm hết khoảng trống còn lại */
}

/* Khung QR Code */
.qr-wrapper {
    text-align: center;
    margin-top: -50px; /* Đẩy lên đè vào header */
    position: relative;
    z-index: 2;
}

.scan-frame {
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: inline-block;
    position: relative;
    overflow: hidden;
}
.scan-frame img, .scan-frame canvas {
    display: block;
    border-radius: 8px;
    max-width: 100%;
}

/* Hiệu ứng thanh quét chạy qua lại QR */
.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    top: 0;
    left: 0;
    animation: scanMove 2s infinite linear;
    opacity: 0.6;
}
@keyframes scanMove {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.qr-instruction {
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
    font-weight: 500;
}

/* Box Nội dung chuyển khoản */
.payment-info-group {
    text-align: left;
}
.info-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.memo-copy-box-styled {
    background: white;
    border: 2px dashed #2563eb; /* Viền nét đứt nhấn mạnh */
    border-radius: 12px;
    padding: 10px 10px 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eff6ff;
}

.memo-text {
    font-family: monospace;
    font-size: 16px;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: 1px;
}

.btn-copy-memo {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-copy-memo:active {
    transform: scale(0.95);
}

.warning-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #d97706;
    font-weight: 600;
    background: #fffbeb;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Nút mở App ngân hàng */
.btn-bank-app-styled {
    display: block;
    width: 100%;
    text-align: center;
    background: #1e293b;
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
}
.btn-bank-app-styled:hover {
    background: #334155;
    transform: translateY(-2px);
}

/* Trạng thái chờ */
.waiting-status-styled {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.waiting-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.waiting-text b {
    font-size: 13px;
    color: #1e293b;
}
.waiting-text span {
    font-size: 11px;
    color: #64748b;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsive tinh chỉnh */
@media (max-width: 480px) {
    .payment-header-styled {
        padding-top: 30px;
    }
    .pay-price-tag {
        font-size: 26px;
    }
}

/* === CSS DANH SÁCH NGÂN HÀNG (SỬA LẠI CHO CHẮC) === */

/* Khung lưới 4 cột */
.bank-grid {
    display: grid !important; /* Buộc phải hiển thị dạng lưới */
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Mỗi ô ngân hàng */
.bank-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none; /* Bỏ gạch chân link */
    cursor: pointer;
    border: none;
    background: transparent;
}

/* Hộp chứa Logo */
.bank-logo-box {
    width: 45px;
    height: 45px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 5px;
}

/* Ảnh Logo */
.bank-logo-box img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block; /* Sửa lỗi hiển thị ảnh vỡ */
}

/* Tên Ngân hàng */
.bank-name {
    font-size: 10px;
    color: #475569;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
}