/* /assets/theme.css */

/* Import font Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

/* Biến màu sắc và font */
:root {
    --bg-dark: #0d1117;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-neon: rgba(100, 255, 218, 0.3);
    --text-main: #e0e6f1;
    --text-secondary: #b0c2d9;
    --accent-neon: #64FFDA;
    --accent-blue: #007bff;
    --accent-red: #dc3545;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

html, body {
    height: 100vh;
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
    /* KHẮC PHỤC: Bỏ overflow: hidden để không bị cắt viền */
}

/* assets/theme.css */

body::before {
    content: '';
    position: fixed; /* Đổi thành fixed để background không cuộn theo trang */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* SỬA LẠI ĐƯỜNG DẪN Ở ĐÂY */
/*     background: url('/assets/matrix_background.jpg') no-repeat center center;
 */    background-size: cover;
    opacity: 1.0; /* Bạn có thể tăng giá trị này nếu muốn ảnh nền rõ hơn */
    z-index: -1;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--accent-neon);
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
}

/* Kiểu dáng chung cho các container chính */
.main-container, .container {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    text-align: center;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
}

/* Header chung cho tất cả các trang */
.header-common {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(28, 30, 33, 0.8);
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    border-radius: 8px;
    flex-wrap: nowrap; /* THÊM DÒNG NÀY: Ngăn không cho các mục xuống dòng */
    gap: 20px; /* THÊM DÒNG NÀY: Tạo khoảng cách tối thiểu giữa các mục */
    backdrop-filter: blur(5px);
    z-index: 1000;
    box-sizing: border-box;
}

.header-common h1 {
    margin: 0;
    font-size: 1.4em;
    margin-bottom: 10px;

}

.header-info {
    display: flex;
    align-items: center;
}

.header-info p {
    margin: 0 15px 0 0;
    font-size: 1em;
    color: var(--text-secondary);
}

.header-buttons a, .header-buttons button {
    background-color: rgba(75, 79, 86, 0.7);
    color: white;
    border: 1px solid var(--accent-neon);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    text-decoration: none;
    display: inline-block;
}

.header-buttons a:hover, .header-buttons button:hover {
    background-color: var(--accent-neon);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.7);
}

/* Grid và Card cho trang chủ */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    width: 100%;
    margin-top: 20px;
    /* KHẮC PHỤC: Để khoảng trống ở hai bên để hiệu ứng hover không bị cắt */
    padding: 0 5px;
    box-sizing: border-box;
}

.service-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-neon);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.service-card:hover {
    /* KHẮC PHỤC: Thay vì scale, ta dùng translate và đổ bóng để tránh lỗi */
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(100, 255, 218, 0.5);
    border-color: var(--accent-neon);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--accent-neon);
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
    margin: 0;
}

.service-card p {
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Menu chọn chatbot */
.chatbot-menu {
    background-color: rgba(255, 255, 255, 0.08); /* Nền hơi trong suốt */
    border: 1px solid var(--accent-neon); /* Viền xanh neon */
    border-radius: 12px;
    padding: 25px; /* Tăng padding */
    position: fixed; /* Đặt menu cố định trên màn hình */
    top: 50%; /* Đặt menu ở giữa màn hình */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000; /* Đảm bảo menu hiển thị trên mọi thứ */
    box-shadow: 0 8px 30px rgba(0,0,0,0.6); /* Đổ bóng mạnh hơn */
    backdrop-filter: blur(12px); /* Hiệu ứng mờ mạnh hơn */
    display: none; /* Mặc định ẩn */
    flex-direction: column;
    gap: 15px; /* Khoảng cách giữa các nút */
    max-width: 350px;
    width: 90%;
}
.chatbot-menu h3 {
    font-family: var(--font-heading);
    color: var(--accent-neon); /* Màu xanh neon */
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.5); /* Hiệu ứng phát sáng */
    margin-top: 0;
    margin-bottom: 20px; /* Tăng khoảng cách */
    font-size: 1.6em; /* Tăng kích thước tiêu đề */
}
.chatbot-menu button {
    background-color: rgba(75, 79, 86, 0.7); /* Nút hơi trong suốt */
    color: var(--text-main); /* Chữ sáng */
    border: 1px solid var(--accent-neon); /* Viền xanh neon */
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease; /* Hiệu ứng chuyển động mượt mà */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-family: var(--font-body);
    font-weight: 700;
    backdrop-filter: blur(3px);
}
.chatbot-menu button:hover {
    background-color: var(--accent-neon); /* Đổi màu nền khi hover */
    color: var(--bg-dark); /* Chữ tối khi hover */
    transform: translateY(-3px); /* Hiệu ứng nâng */
    box-shadow: 0 6px 15px rgba(100, 255, 218, 0.7); /* Phát sáng mạnh hơn */
}
.chatbot-menu .close-button {
    background-color: rgba(220, 53, 69, 0.8); /* Màu đỏ hơi trong suốt */
    border-color: var(--accent-red); /* Viền đỏ */
    margin-top: 15px; /* Tăng khoảng cách */
    box-shadow: 0 4px 10px rgba(220,53,69,0.4);
}
.chatbot-menu .close-button:hover {
    background-color: #c82333;
    border-color: #c82333;
    box-shadow: 0 6px 12px rgba(220,53,69,0.5);
}
.footer-common {
    /* ... */
    margin-top: auto;
    margin-bottom: 20px; /* THÊM DÒNG NÀY: Tạo khoảng cách 20px ở dưới */
    border-radius: 8px; /* TÙY CHỌN: Thêm bo góc cho footer */
    /* ... */
}

/* Thêm media query để hiển thị 2 cột trên các màn hình lớn hơn */
@media (min-width: 769px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-common {
        flex-direction: column;
        text-align: center;
    }
    .header-info {
        margin-top: 10px;
    }

    /* /assets/theme.css */

    /* ... (giữ nguyên các đoạn CSS khác) ... */

    .hero-section p {
        font-size: 2.4em; /* Tăng kích thước phông chữ */
        color: var(--text-secondary);
        line-height: 1.6;
    }

    /* ... (giữ nguyên các đoạn CSS khác) ... */
    }


/* Spinner và hiệu ứng chung */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

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

.control-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: none;
    color: white;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.control-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.control-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

#record-btn {
    background-color: var(--accent-neon);
    color: var(--bg-dark);
}

#stop-btn {
    background-color: var(--accent-red);
    animation: pulse-red 1.5s infinite;
    display: none;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(248, 81, 73, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

/* CSS cho Modal */
/* .modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background-color: var(--bg-dark);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border-neon);
    text-align: center;
    box-shadow: 0 0 25px rgba(100, 255, 218, 0.3);
}
.modal-buttons {
    margin-top: 20px;
}
.modal-buttons button {
    /* Tái sử dụng style nút bấm của bạn hoặc tạo mới */
/*     padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer; */
/* } */ 
/* assets/theme.css - THÊM VÀO CUỐI FILE */

.header-left {
    text-align: left;
}

.header-left .header-title {
    margin-bottom: 5px; /* Tạo khoảng cách nhỏ giữa tiêu đề và lời chào */
}

.welcome-text {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Đảm bảo nút "Đăng nhập" mới có giao diện giống các nút khác */
.header-buttons .login-btn {
    background-color: rgba(75, 79, 86, 0.7);
    color: white;
    border: 1px solid var(--accent-neon);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    text-decoration: none;
    display: inline-block;
}

.header-buttons .login-btn:hover {
    background-color: var(--accent-neon);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.7);
}
/* assets/theme.css - THÊM VÀO CUỐI FILE */

/* Lớp phủ cho pop-up */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Mặc định ẩn */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Style chung cho các pop-up */
.popup-style {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--accent-neon);
    border-radius: 12px;
    padding: 25px;
    z-index: 10000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
    width: 90%;
    text-align: center;
}

.popup-style h3 {
    font-family: var(--font-heading);
    color: var(--accent-neon);
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.6em;
}

.popup-style p {
    color: var(--text-secondary);
    font-size: 1em;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.popup-style .popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.popup-style button {
    background-color: rgba(75, 79, 86, 0.7);
    color: var(--text-main);
    border: 1px solid var(--accent-neon);
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-family: var(--font-body);
    font-weight: 700;
    backdrop-filter: blur(3px);
    flex-grow: 1; /* Cho các nút có độ rộng bằng nhau */
}

.popup-style button:hover {
    background-color: var(--accent-neon);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(100, 255, 218, 0.7);
}

.popup-style button.cancel-btn {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.popup-style button.cancel-btn:hover {
    background-color: var(--text-secondary);
    color: var(--bg-dark);
    border-color: var(--text-secondary);
    box-shadow: 0 6px 15px rgba(176, 194, 217, 0.4);
}
/* /assets/theme.css - THÊM VÀO CUỐI FILE */

.footer-common {
    width: 100%;
    max-width: 900px;
    background-color: rgba(28, 30, 33, 0.8);
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    margin-top: auto; /* Đẩy footer xuống cuối */
    border-top: 1px solid var(--border-neon);
    box-sizing: border-box;
    font-size: 0.9em;
    backdrop-filter: blur(5px);
}

.footer-common p {
    margin: 0;
    line-height: 1.6;
}

.footer-common a {
    color: var(--accent-neon);
    text-decoration: none;
    font-weight: 700;
    transition: text-shadow 0.3s ease;
}

.footer-common a:hover {
    text-shadow: 0 0 8px var(--accent-neon);
}
/* assets/theme.css - Thêm vào cuối file */

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit; /* Kế thừa màu chữ từ cha */
}

.header-logo {
    height: 40px; /* Điều chỉnh chiều cao logo */
    width: auto;
    margin-right: 15px; /* Khoảng cách giữa logo và tiêu đề */
}

.header-left .header-title {
    margin-bottom: 0; /* Bỏ margin bottom khi có logo */
}
/* Thêm đoạn CSS này vào cuối file theme.css */

/* /assets/theme.css */

/* ... (toàn bộ nội dung file theme.css của bạn) ... */

/* THAY THẾ ĐOẠN CSS CŨ BẰNG ĐOẠN NÀY */
.popup-buttons .cancel-btn {
    background-color: #dc3545 !important; /* Thêm !important để ưu tiên */
    border: 1px solid #dc3545 !important;
    color: white !important;
}

.popup-buttons .cancel-btn:hover {
    background-color: #c82333 !important;
    border: 1px solid #c82333 !important;
}