* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

/* Giữ cố định không gian Scrollbar để tránh giật/dịch chuyển giao diện */
html {
    scrollbar-gutter: stable;
}

body {
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 700px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: #1e293b;
    font-size: 1.8rem;
}

header p {
    color: #64748b;
    font-size: 1rem;
    margin-top: 5px;
}

/* Search Box Layout */
.search-box {
    display: flex;
    gap: 10px;
    position: relative;
    margin-bottom: 15px;
    /* custom */
    background-color: #E0EEF6;
    padding: 20px;
}

.input-group {
    flex: 1;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
    border-color: #0d7ca5;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/*
.select-wrapper {
    position: relative;
    display: inline-block;
}

select {
    padding: 12px 40px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.2s ease-in-out;
}

select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}


select option {
    padding: 10px;
    background-color: #ffffff;
    color: #334155;
    font-size: 0.95rem;
}
    */

/* Stylize Menu Dropdown Hiện đại & Bo góc đồng bộ */
.select-wrapper {
    position: relative;
    display: inline-block;
}

select {
    padding: 12px 38px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    /* Mũi tên SVG tối giản màu xám xanh */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    outline: none;

    /* Xóa icon mặc định thô cứng trên mọi trình duyệt */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    transition: all 0.2s ease-in-out;
}

select:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

select:focus {
    border-color: #0d7ca5;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Tùy chỉnh danh sách Option khi xổ xuống */
select option {
    padding: 10px 14px;
    background-color: #ffffff;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 500;
}

button {
    padding: 12px 20px;
    background-color: #0d7ca5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0b6180;
}

/* Autocomplete Menu & Scrollbar */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    list-style: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: none;
}

/* Tùy chỉnh thanh cuộn đẹp mắt cho Autocomplete */
.autocomplete-list::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.autocomplete-list li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover {
    background-color: #f8fafc;
}

/* Status Loading */
.status-message {
    font-size: 0.85rem;
    color: #d97706;
    min-height: 20px;
    margin-bottom: 10px;
    font-style: italic;
}

/* Result Container & Custom Scrollbar */
.result-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8fafc;
    min-height: 120px;
    max-height: none; /* max-height: 450px; */
    overflow-y: auto;
}

.result-container::-webkit-scrollbar {
    width: 6px;
}

.result-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.placeholder-text {
    color: #94a3b8;
    text-align: center;
    margin-top: 30px;
}

.dictionary-item {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.dictionary-item:last-child {
    border-bottom: none;
}

.word-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.word-meaning {
    font-size: 1rem;
    color: #475569;
    margin-top: 4px;
}

/* Fix lỗi lệch chữ khi Highlight từ khóa */
mark.highlight {
    background-color: #fef08a;
    color: #854d0e;
    padding: 0;
    margin: 0;
    border-radius: 2px;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    display: inline;
}

@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
    }
}