/* Custom Styles for New Interface */
:root {
    --primary-color: #007bff; /* Financial blue color */
    --text-color: #ffffff;
    --bg-color: #000;
    --border-glow-color: #00ffff;
    
    /* Variables added for AI Trading page */
    --glow-color: #00ffff;
    --background-color-dark: #0a0a14;
    --border-color-ai: rgba(0, 255, 255, 0.2);
    --primary-color-ai: #f0b90b;
    --positive-color: #16c784;
    --negative-color: #ea3943;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--bg-color) url('img/background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

        /* Biến màu để tương thích với trang của bạn */
        :root {
            --primary-color: #007bff;
            --text-color: #ffffff;
            --border-glow-color: #00ffff;
        }

        /* Reset cơ bản */
        body {
            margin: 0;
            font-family: sans-serif;
            background-color: #0a0a14; /* Nền tối để dễ nhìn */
        }
        
        /* --- CODE HEADER HOÀN CHỈNH --- */
        #main-header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 50px;
            background-color: var(--primary-color);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
            border-bottom: 2px solid var(--border-glow-color);
        }

        .header-container {
            width: 100%;
            max-width: 1200px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }

        .logo-container {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: var(--text-color);
            /* Đảm bảo logo không bị đẩy xuống */
            flex-shrink: 0; 
        }

        .logo-container img {
            height: 40px;
            margin-right: 15px;
        }

        .header-title {
            font-weight: bold;
            font-size: 1em;
            letter-spacing: 1px;
            white-space: nowrap;
        }

        /* --- Menu cho máy tính --- */
        .main-navigation {
            display: flex; /* Mặc định hiển thị trên desktop */
        }

        .main-navigation ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            align-items: center;
        }

        .main-navigation li {
            margin-left: 25px;
        }

        .main-navigation a {
            color: var(--text-color);
            text-decoration: none;
            font-weight: bold;
        }

        /* --- Nút Menu 3 sọc cho di động --- */
        .menu-toggle {
            display: none; /* Mặc định ẩn trên desktop */
            width: 30px;
            height: 25px;
            background: transparent;
            border: none;
            cursor: pointer;
            z-index: 1100;
        }

        .menu-toggle .bar {
            display: block;
            width: 100%;
            height: 3px;
            background-color: white;
            border-radius: 10px;
            margin: 5px 0;
            transition: all 0.3s ease-in-out;
        }

        /* --- QUY TẮC RESPONSIVE QUAN TRỌNG NHẤT --- */
        @media (max-width: 768px) {
            .header-title {
                /* Ẩn tiêu đề chữ để có không gian cho logo và nút menu */
                display: none; 
            }
            
            .main-navigation {
                /* Ẩn menu ngang và chuẩn bị cho menu xổ dọc */
                display: none;
                position: absolute;
                top: 50px;
                left: 0;
                width: 100%;
                background-color: rgba(0, 100, 200, 0.98);
            }
            
            /* LỚP .is-open SẼ ĐƯỢC JAVASCRIPT THÊM VÀO ĐỂ HIỂN THỊ MENU */
            .main-navigation.is-open {
                display: block;
            }

            .main-navigation ul {
                flex-direction: column; /* Chuyển menu thành cột dọc */
            }

            .main-navigation li {
                margin: 0;
                width: 100%;
                text-align: center;
                border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            }

            .main-navigation a {
                display: block;
                padding: 15px;
            }

            .menu-toggle {
                /* HIỂN THỊ NÚT 3 SỌC */
                display: block !important; /* Dùng !important để đảm bảo không bị quy tắc nào khác ghi đè */
            }
        }

/* --- RESPONSIVE STYLES (MEDIA QUERIES) --- */
@media (max-width: 992px) { /* Breakpoint for tablets and smaller */
    .header-title {
        display: none; /* Hide title on smaller screens for more space */
    }
}

@media (max-width: 768px) { /* Breakpoint for mobile phones */
    .header-title {
        /* Re-display the title on mobile as requested */
        display: block; 
        font-size: 0.7em; /* Make title smaller to fit */
    }
    
    .main-navigation {
        display: none; /* Hide the desktop nav */
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background-color: rgba(0, 100, 200, 0.98);
        backdrop-filter: blur(5px);
    }
    
    .main-navigation.is-open {
        display: block; /* Show nav when button is clicked */
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }

    .main-navigation li {
        margin: 0;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        display: block;
        padding: 20px;
    }

    .menu-toggle {
        display: flex; /* Show the hamburger button */
    }
}

#main-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
#main-header nav li { margin-left: 20px; }
#main-header nav a { color: var(--text-color); text-decoration: none; font-weight: bold; font-size: 16px; transition: color 0.3s ease; }
#main-header nav a:hover { color: var(--border-glow-color); }
#main-header::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); animation: shine 5s infinite; }
@keyframes shine { 0% { left: -100%; } 50% { left: 100%; } 100% { left: -100%; } }

/* Main Content Layout */
#main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    padding: 70px 20px 20px 20px;
    min-height: calc(100vh - 120px);
    margin: 0 auto;
    gap: 20px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.main-row { display: flex; gap: 20px; width: 100%; }
.main-article-column { flex: 3; }
.sidebar-column { flex: 1; }
#Particle-ground { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }

.block-container {
    background-color: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    width: 100%;
    box-sizing: border-box;
}

.block-container h2 { color: var(--border-glow-color); margin-top: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 10px; margin-bottom: 15px; }

/* Welcome Section */
.welcome-section {
    width: 100%;
    padding: 30px 0;
    text-align: center;
}
.welcome-text {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; 
}
.welcome-text span {
    font-size: 4rem;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(45deg, var(--primary-color), var(--border-glow-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: wave-animation 2.5s infinite;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}
.welcome-text span:hover {
    transform: scale(1.2);
    text-shadow: 0 0 15px var(--border-glow-color);
}
.welcome-text span.space {
    width: 1.5rem; 
    animation: none; 
}
.welcome-text span:nth-of-type(1) { animation-delay: 0.1s; }
.welcome-text span:nth-of-type(2) { animation-delay: 0.2s; }
.welcome-text span:nth-of-type(3) { animation-delay: 0.3s; }
.welcome-text span:nth-of-type(4) { animation-delay: 0.4s; }
.welcome-text span:nth-of-type(5) { animation-delay: 0.5s; }
.welcome-text span:nth-of-type(6) { animation-delay: 0.6s; }
.welcome-text span:nth-of-type(7) { animation-delay: 0.7s; }
.welcome-text span:nth-of-type(9) { animation-delay: 0.8s; }
.welcome-text span:nth-of-type(10) { animation-delay: 0.9s; }
.welcome-text span:nth-of-type(12) { animation-delay: 1.0s; }
.welcome-text span:nth-of-type(13) { animation-delay: 1.1s; }
.welcome-text span:nth-of-type(14) { animation-delay: 1.2s; }
.welcome-text span:nth-of-type(15) { animation-delay: 1.3s; }
.welcome-text span:nth-of-type(16) { animation-delay: 1.4s; }
.welcome-text span:nth-of-type(17) { animation-delay: 1.5s; }
.welcome-text span:nth-of-type(18) { animation-delay: 1.6s; }
.welcome-text span:nth-of-type(19) { animation-delay: 1.7s; }
.welcome-text span:nth-of-type(20) { animation-delay: 1.8s; }
.welcome-text span:nth-of-type(21) { animation-delay: 1.9s; }

@keyframes wave-animation {
    0%, 40%, 100% { transform: translateY(0); }
    20% { transform: translateY(-20px); }
}

/* Market Section */
.trading-view-container { flex: 1; height: 450px; }

/* Login Block */
.login-block input { width: calc(80% - 22px); padding: 10px; margin-bottom: 10px; border: 1px solid var(--primary-color); background-color: rgba(255, 255, 255, 0.1); color: var(--text-color); border-radius: 5px; }
.btn { width: 80%; padding: 10px 20px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease; text-decoration: none; display: inline-block; text-align: center; }
.login-btn { background-color: var(--primary-color); color: var(--text-color); }
.login-btn:hover { background-color: #0056b3; }
.register-btn { background-color: #34495e; color: var(--text-color); margin-top: 10px; }
.register-btn:hover { background-color: #2c3e50; }

/* Logo Grid */
.logo-container-fullwidth { width: 100%; }
.logo-grid { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; gap: 20px; }
.logo-grid img { height: 50px; width: auto; max-width: 120px; transition: transform 0.3s ease, filter 0.3s ease; filter: grayscale(50%); }
.logo-grid img:hover { transform: scale(1.1); filter: grayscale(0%); }

/* Footer */
#main-footer { text-align: center; padding: 20px; color: #aaa; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.corporate-img { max-width: 100%; height: auto; }

/* Popup Modal */
.modal { display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); justify-content: center; align-items: center; }
.modal-content { background-color: #1a1a1a; padding: 30px; border: 2px solid var(--border-glow-color); border-radius: 10px; box-shadow: 0 0 20px var(--border-glow-color); text-align: center; position: relative; max-width: 500px; margin: auto; }
.close-btn { color: #fff; font-size: 28px; font-weight: bold; position: absolute; top: 10px; right: 20px; cursor: pointer; }

/* Support Center Popup */
#support-icon { position: fixed; bottom: 20px; right: 20px; width: 50px; height: 50px; background-color: var(--primary-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 1002; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.3s ease; }
#support-icon:hover { transform: scale(1.1); }
#support-icon img { width: 60%; height: 60%; }
#support-popup { position: fixed; bottom: 80px; right: 20px; width: 220px; background-color: rgba(20, 40, 70, 0.9); backdrop-filter: blur(8px); border-radius: 10px; padding: 15px; border: 1px solid var(--border-glow-color); box-shadow: 0 4px 20px rgba(0,0,0,0.5); z-index: 1001; visibility: hidden; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s; }
#support-popup.show { visibility: visible; opacity: 1; transform: translateY(0); }
#support-popup h3 { margin-top: 0; color: var(--border-glow-color); font-size: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 5px; }
#support-popup p { font-size: 14px; line-height: 1.5; margin: 8px 0; }
#support-popup a { color: var(--text-color); text-decoration: none; }
#support-popup a:hover { text-decoration: underline; }

/* --- Styles for AI Trading Page --- */
.ai-trading-header { text-align: center; color: var(--text-color); margin-bottom: 20px; }
.ai-trading-header h1 { font-size: 2em; font-weight: 500; letter-spacing: 1px; color: var(--primary-color-ai); margin-top: 0; }
.ai-trading-header img { height: 40px; margin-bottom: 10px; }
.kpi-databoard-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 100%; }
.coin-block { background-color: rgba(10, 10, 20, 0.8); backdrop-filter: blur(5px); border: 1px solid var(--border-color-ai); border-radius: 12px; padding: 20px; position: relative; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.coin-block:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); }
.coin-block::before { content: ''; position: absolute; top: 50%; left: 50%; width: 400%; height: 400%; background: conic-gradient(transparent, transparent, transparent, var(--glow-color)); transform-origin: center center; transform: translate(-50%, -50%); animation: rotate 6s linear infinite; z-index: 1; }
.coin-block::after { content: ''; position: absolute; inset: 2px; background-color: var(--background-color-dark); border-radius: 10px; z-index: 2; }
.coin-block-content { position: relative; z-index: 3; }
@keyframes rotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.coin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 10px; }
.coin-symbol { font-size: 28px; font-weight: 700; color: var(--primary-color-ai); }
.price-info { display: flex; align-items: baseline; gap: 8px; }
.coin-price { font-size: 26px; font-weight: 500; color: var(--primary-color-ai); }
.coin-id { font-size: 14px; color: #a0a0a0; font-weight: 400; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-item { background-color: rgba(255, 255, 255, 0.05); padding: 8px 12px; border-radius: 6px; }
.stat-label { font-size: 12px; color: #a0a0a0; margin-bottom: 4px; text-transform: uppercase; }
.stat-value { font-size: 16px; font-weight: 600; }
.stat-value.positive { color: var(--positive-color); }
.stat-value.negative { color: var(--negative-color); }
.stat-value .loss-value { color: var(--negative-color); }
.ai-footer { text-align: center; padding: 15px; margin-top: 20px; border-top: 1px solid #222; font-size: 14px; color: #888; width: 100%; }
.ai-footer p { margin: 5px 0; }

/* --- Styles for AI Finance Page --- */
.page-title {
    text-align: center;
    color: var(--border-glow-color);
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}
.service-packages-container {
    display: flex;
    gap: 25px;
    width: 100%;
    align-items: stretch; /* Make cards same height */
}
.package-card {
    background-color: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0; /* For load animation */
    transform: translateY(20px); /* For load animation */
    animation: fadeInUp 0.6s ease-out forwards;
}
.package-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}
/* Staggered animation */
.package-card:nth-child(1) { animation-delay: 0.2s; }
.package-card:nth-child(2) { animation-delay: 0.4s; }
.package-card:nth-child(3) { animation-delay: 0.6s; }
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.package-card.premium { /* Highlight premium package */
    border-color: var(--primary-color-ai);
    box-shadow: 0 0 30px rgba(240, 185, 11, 0.3);
}
.package-card h3 {
    font-size: 2rem;
    color: var(--primary-color-ai);
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}
.package-summary {
    color: #ccc;
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
    min-height: 40px; /* Reserve space */
}
.package-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
}
.package-price span {
    font-size: 1rem;
    font-weight: normal;
    color: #bbb;
}
.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    flex-grow: 1; /* Pushes button to bottom */
}
.features-list li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
}
.features-list li::before {
    content: '✓';
    color: var(--positive-color);
    margin-right: 10px;
    font-weight: bold;
}
.btn-register-package {
    background-color: var(--primary-color-ai);
    color: #111;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: auto; /* Stick to bottom */
}
.btn-register-package:hover {
    background-color: #ffd666;
    box-shadow: 0 0 15px rgba(240, 185, 11, 0.5);
}

/* Responsive design */
@media (max-width: 992px) {
    .main-row, .service-packages-container { flex-direction: column; }
    .header-title { display: none; }
    .welcome-text span { font-size: 3rem; }
    .kpi-databoard-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    #main-content { padding: 70px 10px 10px 10px; }
    #main-header nav { display: none; }
    .welcome-text span { font-size: 2rem; }
    .kpi-databoard-container { grid-template-columns: 1fr; }
    .page-title { font-size: 2rem; }
}