body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-x: hidden;
}
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 250px;
    width: 100%;
    height: auto;
}

/* CSS cho header và menu chung cho tất cả các trang */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-logo img {
    max-height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
}

.nav-menu a i {
    margin-right: 5px;
}

.nav-menu a span.menu-text {
    display: inline;
}

/* Media query cho điện thoại */
@media (max-width: 768px) {
    .header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
    }
    
    .header-logo img {
        max-height: 40px;
        width: auto;
    }
    
    .nav-menu {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }
    
    .nav-menu a span.menu-text {
        display: none !important;
    }
    
    .nav-menu a {
        padding: 8px 12px;
        text-align: center;
    }
    
    .nav-menu a i {
        margin-right: 0;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 200px;
    }
}

h2 {
    text-align: center;
    color: #fe2c55;
    margin-bottom: 30px;
}
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 480px) {
    input[type="text"], textarea {
        padding: 10px;
        font-size: 14px;
    }
}

textarea {
    height: 80px;
    resize: vertical; /* Cho phép thay đổi chiều cao */
    min-height: 60px; /* Chiều cao tối thiểu */
    max-height: 300px; /* Chiều cao tối đa */
}

button {
    background-color: #fe2c55;
    color: white;
    border: none;
    padding: 10px 10px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #e6254e;
}

#clearBtn {
    background-color: #777;
    width: auto;
    min-width: 50px;
    padding: 0 10px;
    font-size: 14px;
}

#clearBtn:hover {
    background-color: #555;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.button-wrapper {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.button-wrapper button {
    min-width: 120px;
}

/* Màn hình máy tính */
@media (min-width: 768px) {
    .button-group button {
        min-width: 180px;
    }
}

/* Màn hình điện thoại */
@media (max-width: 480px) {
    .button-group button {
        flex: 1;
        min-width: 120px;
    }
}

/* Xử lý đầu vào với nút */
.input-with-button {
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: stretch;
}

/* Áp dụng đáp ứng cho màn hình lớn */
@media (min-width: 768px) {
    .input-with-button {
        display: flex;
        align-items: stretch;
    }
    
    .input-with-button textarea,
    .input-with-button input[type="text"] {
        flex: 1;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    .input-with-button button {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        padding: 0 15px;
        height: 45px; /* Chiều cao cố định cho các nút */
    }
}

/* Đảm bảo các nút luôn hiển thị đầy đủ nội dung */
button {
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.footer {
    margin-top: 30px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.guide-link {
    color: #fe2c55;
    text-decoration: none;
}

.guide-link:hover {
    text-decoration: underline;
}

.guide-container {
    text-align: center;
    margin: -10px auto 20px;
    width: 100%;
}

/* Header và menu */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    width: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: auto; /* Đẩy logo về bên trái */
}

.header-logo img {
    max-width: 100px;
    width: auto;
}

.nav-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 0;
    flex: 0 0 auto;
    margin-left: auto; /* Đẩy menu về bên phải */
}

.nav-menu a {
    color: #fe2c55;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.nav-menu a:hover {
    background-color: #fe2c55;
    color: white;
    text-decoration: none;
}

.nav-menu .separator {
    color: #ccc;
    margin: 0 5px;
}

/* Responsive menu */
@media (max-width: 768px) {
    .header {
        flex-direction: row; /* Giữ dạng hàng */
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap; /* Ngăn không cho xuống dòng */
    }
    
    .header-logo {
        flex: 0 0 auto;
        margin-right: 10px; /* Khoảng cách giữa logo và menu */
    }
    
    .header-logo img {
        max-width: 80px; /* Logo nhỏ hơn trên điện thoại */
    }
    
    .nav-menu {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    
    .nav-menu a {
        margin-left: 5px;
        padding: 2px 5px;
        font-size: 12px; /* Chữ nhỏ hơn trên điện thoại */
    }
}

.main-guide-link {
    display: inline-block;
    font-weight: bold;
    font-size: 16px;
}

/* CSS cho phần thống kê */
.counter-stats {
    margin-top: 5px;
    margin-bottom: 10px;
}

.counter-box {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.counter-box h4 {
    color: #fe2c55;
    margin-top: 0;
    margin-bottom: 5px;
    text-align: center;
    font-size: 14px;
}

.counter-item {
    flex: 1;
    min-width: 100px;
    background-color: white;
    padding: 5px;
    border-radius: 6px;
    text-align: center;
    border-left: 3px solid #fe2c55;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.counter-item i {
    color: #fe2c55;
    margin-right: 5px;
}

.counter-item span {
    font-weight: bold;
    color: #333;
}

.history-link {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    color: #fe2c55;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #fff8f9;
    transition: all 0.3s ease;
}

.history-link:hover {
    background-color: #fe2c55;
    color: white;
}

.history-link i {
    margin-right: 3px;
}

@media (max-width: 480px) {
    .counter-items {
        flex-direction: column;
    }
    
    .counter-item {
        width: 100%;
    }
    
    .history-link {
        display: block;
        margin: 8px auto 0;
        width: fit-content;
    }
}

.guide-note {
    background-color: #fff8e6;
    border-left: 4px solid #ffcc00;
    padding: 1px 10px;
    margin: 10px 0;
}

.guide-tip {
    background-color: #e6f7ff;
    border-left: 4px solid #1890ff;
    padding: 1px 10px;
    margin: 10px 0;
}

.back-to-tool {
    display: inline-block;
    background-color: #fe2c55;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.back-to-tool:hover {
    background-color: #e6173e;
}
