/**
 * File: assets/css/frontend.css
 * Chức năng: Hệ thống thiết kế "Vô hạn" cho Narrative Funnel.
 * Hỗ trợ: Bơm Style động từ AI, Layout linh hoạt và trải nghiệm Authority chuẩn mực.
 */

/* --- 1. BIẾN HỆ THỐNG MẶC ĐỊNH (FALLBACKS) --- */
:root {
    /* Màu sắc Authority mặc định */
    --haki-primary: #003366;
    --haki-accent: #ff6a00;
    --haki-text-main: #1e293b;
    --haki-bg-light: #ffffff;
    
    /* Font chữ mặc định */
    --haki-serif: 'Merriweather', serif;
    --haki-sans: 'Roboto', sans-serif;

    /* Cấu trúc mặc định (Sẽ bị AI ghi đè qua Inline Style) */
    --section-bg: var(--haki-bg-light);
    --section-text: var(--haki-text-main);
    --section-padding: 80px 0;
    --section-title-color: var(--haki-primary);
    --section-border: none;
    --section-radius: 0px;
}

/* --- 2. RESET & CẤU TRÚC CHUNG --- */
.haki-funnel-rendering-engine {
    font-family: var(--haki-sans);
    font-size: 18px;
    line-height: 1.8;
    color: var(--haki-text-main);
    background-color: #f4f7f4; /* Nền trung tính như Wise Mentor */
    -webkit-font-smoothing: antialiased;
}

.haki-container {
    max-width: 1100px; /* Độ rộng tối ưu như Wise Mentor */
    margin: 0 auto;
    padding: 0 25px;
    box-sizing: border-box;
}

/* --- 3. HỆ THỐNG SECTION ĐỘNG (THE HEART OF AI DESIGN) --- */
.haki-section {
    position: relative;
    width: 100%;
    /* Sử dụng các biến để AI ghi đè trực tiếp */
    background-color: var(--section-bg);
    color: var(--section-text);
    padding: var(--section-padding);
    border: var(--section-border);
    border-radius: var(--section-radius);
    transition: all 0.3s ease;
}

/* Đặc trị cho Section đầu tiên: Hook */
.haki-section-hook {
    padding-top: 30px !important; /* Chỉ để một khoảng nhỏ 30px trên đầu */
}

/* Thêm vào để fix khoảng trắng do WP Admin Bar (nếu có) */
.admin-bar .haki-section-hook {
    padding-top: 50px !important;
}

.haki-section h1, 
.haki-section h2, 
.haki-section h3 {
    color: var(--section-title-color);
    margin-top: 0;
}

/* --- 4. HỆ THỐNG LAYOUT LINH HOẠT (AI CONTROLLED) --- */

/* Layout Standard: Nội dung chảy dọc */
.haki-layout-standard { text-align: left; }

/* Layout Grid 2: Chia 2 cột (Dành cho Module, Curriculum như Wise Mentor) */
.haki-layout-grid-2 .haki-section-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Layout Card: Biến cả section thành một khối card nổi */
.haki-layout-card {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin: 40px auto;
    border-radius: 12px;
    max-width: 1000px;
}

/* --- 5. COMPONENTS CHUẨN AUTHORITY --- */

/* Tiêu đề Section (Style Wise Mentor: Đậm, viết hoa, có thể có nền) */
.haki-section-title {
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 35px;
    display: block;
}

/* Quote / Motto Box: Kiểu nhấn mạnh triết lý */
.haki-quote, .haki-motto-box {
    font-family: var(--haki-serif);
    font-size: 22px;
    font-style: italic;
    font-weight: bold;
    text-align: center;
    padding: 30px;
    margin: 30px 0;
    border: 2px dashed var(--haki-accent);
    background: #fff9f7;
    color: var(--haki-accent);
    border-radius: 10px;
}

/* Alert / Highlight Box */
.haki-box {
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 6px solid var(--haki-primary);
    background: #f8fafc;
}

/* List Items with Checkmarks (IPRR Style) */
.haki-list { list-style: none; padding: 0; }
.haki-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.haki-list-item::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--haki-primary);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
}

/* --- 6. FLOATING UI (STICKY CTA & FAB) --- */

.haki-sticky-cta {
    position: fixed;
    bottom: 30px;
    left: 50%;
    z-index: 9999;
    transform: translateX(-50%) translateY(150%);
    opacity: 0;
    visibility: hidden;
    background-color: var(--haki-accent);
    color: #ffffff;
    padding: 18px 45px;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(255, 106, 0, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.haki-sticky-cta.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.haki-fab-container {
    position: fixed;
    bottom: 110px;
    right: 25px;
    z-index: 9998;
}

.haki-fab-button {
    width: 56px;
    height: 56px;
    background: var(--haki-primary);
    border-radius: 14px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: white;
}

.haki-fab-list {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.haki-fab-container.open .haki-fab-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.haki-fab-link {
    display: block;
    padding: 15px 20px;
    color: var(--haki-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
}

.haki-fab-link:hover {
    background: #fff4e6;
    color: var(--haki-accent);
}

/* --- 7. RESPONSIVE (MOBILE OPTIMIZATION) --- */
@media (max-width: 850px) {
    .haki-layout-grid-2 .haki-section-content {
        grid-template-columns: 1fr;
    }
    .haki-section { padding: 50px 0; }
    .haki-container { padding: 0 20px; }
}

@media (max-width: 600px) {
    .haki-sticky-cta { width: 90%; font-size: 16px; padding: 15px; }
    .haki-section-title { font-size: 20px; }
}