:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #f0f0f0; /* Light gray */
    --text-color: #333;
    --button-color: #fff;
    --border-radius: 12px;
    --font-size-base: 16px;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow: hidden;
}

.screen {
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
}
.screen.active {
    display: flex;
}

/* General UI Elements */
.header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
}
.header h2 {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}
.header .home-btn {
    font-size: 24px;
    cursor: pointer;
}

/* Floating Bars */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.chat-input-area {
    display: flex;
    padding: 10px;
    gap: 10px;
    border-top: 1px solid #eee;
}
.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #eee;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #777;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-item:hover {
    color: var(--primary-color);
}
.nav-item .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Homepage Styling */
#homepage {
    justify-content: center;
    align-items: center;
}
.homepage-content {
    text-align: center;
    padding: 20px;
}
.homepage-content h1 {
    font-size: 24px;
    margin-bottom: 20px;
}
.homepage-content p {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
}
.chatbot-button {
    background-color: var(--button-color);
    color: var(--text-color);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}
.chatbot-button:active {
    transform: scale(0.98);
}
.chatbot-button .icon {
    font-size: 40px;
    margin-right: 15px;
    line-height: 1;
}
.chatbot-button .text-content {
    flex-grow: 1;
}
.chatbot-button .text-content h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}
.chatbot-button .text-content p {
    margin: 0;
    font-size: 14px;
    color: #777;
}

/* Chatbot Page Styling */
#chatbot-page {
    justify-content: space-between;
    background-color: #fff;
    padding-bottom: 124px; /* Space for fixed bottom bar */
}
.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-bubble {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    word-wrap: break-word;
}
.chat-bubble.ai {
    background-color: #e0f2e0; /* light green */
    align-self: flex-start;
}
.chat-bubble.user {
    background-color: #dcf8c6; /* light green for user too to make it simple */
    align-self: flex-end;
    text-align: right;
}
.chat-bubble a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    gap: 10px;
    border-top: 1px solid #eee;
}
.chat-input-area input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
}
.chat-input-area button {
    background-color: var(--primary-color);
    color: var(--button-color);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}
.chat-input-area button:active {
    transform: scale(0.9);
}

/* Login Page Styling */
#login-page {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-bottom: 70px; /* Space for fixed footer */
}
#login-page h1 {
    font-size: 24px;
    margin-bottom: 10px;
}
#login-page p {
    margin-bottom: 30px;
    color: #777;
}
.login-btn-group button {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    cursor: pointer;
}
#zalo-login-btn {
    background-color: #0068ff;
    color: white;
    border: none;
}

/* Utility classes */
.text-center {
    text-align: center;
}
.full-width-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--button-color);
    border: none;
    border-radius: var(--border-radius);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

/* Font Size Button */
#font-size-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.hidden { display: none; }
/* Ẩn ô nhập liệu gốc khi hiển thị chatbot iframe */
#chatbot-page .chat-input-area {
    display: none;
}