/* RESET + BASE */

a {
    text-decoration: none;
    color: inherit;
}

/* PAGE WRAPPER */
.page {
    background: #FAFAFA;
}
.page {
    font-family: "Nunito", sans-serif;
}
.page div,.page p,.page section {
    font-family: "Nunito", sans-serif;
}

.page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 18px;
}

/* HEADER */
.page .header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 18px;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.header-illustration {
    width: 72px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fde68a, #f9a8d4);
}

.header-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: .03em;
}

/* SEARCH */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.search-input-wrap {
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 18px;
    outline: none;
}

.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.search-button {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 18px;
    font-weight: 600;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-button::before {
    content: "🔍";
    font-size: 18px;
}

.search-button:hover {
    background: #1d4ed8;
}

/* LAYOUT */
.content {
    display: flex;
    gap: 26px;
    min-height: 400px;
}

.main-column {
    flex: 2.2;
}

.side-column {
    flex: 1;
}

/* WORD HEADER */
.word-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.word-title {
    font-size: 28px;
    font-weight: 800;
}

.audio-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #e5f0ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* CHIPS */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.chip {
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    font-size: 16px;
    background: #f9fafb;
    cursor: pointer;
}

.chip-primary {
    background: #CAEBFF;
    color: #424242;
    font-size: 16px;
}

/* DEFINITION SECTION */
.main-layout-top {
    display: grid;
    grid-template-columns: 2.1fr 1.2fr;
    gap: 16px;
    align-items: flex-start;
}

.section-title {
    font-weight: 700;
    color: #3A89FF;
    margin-bottom: 8px;
}

.tag-part-of-speech {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #FFEEE5;
    color: #FF7979;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tag-adj {
    background: #fef3c7;
    color: #b45309;
    margin-top: 14px;
}

.definition-item {
    margin-bottom: 8px;
}

.definition-item .index {
    font-weight: 600;
    margin-right: 4px;
}

.example {
    font-size: 18px;
    color: #6b7280;
    margin-left: 22px;
    margin-bottom: 6px;
}

.example-label {
    font-style: italic;
    margin-right: 4px;
}

/* ILLUSTRATION */
.illustration-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
}

.illustration-img {
    height: 140px;
    background: linear-gradient(135deg, #bfdbfe, #f9a8d4);
}

.illustration-caption {
    padding: 8px 10px 10px;
    font-size: 16px;
    text-align: center;
    color: #4b5563;
    background: #fff;
}

/* EXAMPLE BLOCK (COLLAPSIBLE) */
.link-more {
    margin-top: 14px;
    font-size: 18px;
    color: #2563eb;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0;
}

.example-block {
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: max-height .25s ease;
}

.example-block-header {
    padding: 10px 14px;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.example-block-title {
    font-size: 18px;
    font-weight: 600;
    margin: 14px 0;
}

.example-block-body {
    padding: 14px 18px 18px;
    font-size: 18px;
}

.example-section {
    margin-bottom: 14px;
}

.example-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
}

.circle-number {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #e5f0ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #1d4ed8;
}

.example-list {
    list-style: disc;
    padding-left: 24px;
    line-height: 1.5;
}

.example-list li {
    margin: 12px 0;
}

/* GENERIC COLLAPSIBLE */
.collapsible {
    overflow: hidden;
}

.collapsible.closed .example-block-body,
.collapsible.closed .collapse-panel {
    display: none;
}

.collapse-arrow {
    transition: transform .2s ease;
}

.collapsible.closed .collapse-arrow {
    transform: rotate(180deg);
}

/* ĐỒNG NGHĨA & TRÁI NGHĨA */
.block-card {
    margin-top: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 16px 18px 10px;
    font-size: 18px;
}

.block-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 10px;
}

.meaning-heading {
    font-weight: 600;
    margin-top: 6px;
    margin-bottom: 4px;
}

.syn-row-label {
    font-weight: 600;
    margin-right: 4px;
}

.pill-row {
    margin: 4px 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 18px;
}

/*.pill-anton {
    background: #fee2e2;
    border-color: #fecaca;
}*/

.collapse-btn {
    margin-top: 4px;
    margin-bottom: 4px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    padding: 8px 10px;
    font-size: 18px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.collapse-panel {
    padding: 8px 10px 10px;
    font-size: 18px;
    color: #4b5563;
    display: none;
}

.collapse-panel.open {
    display: block;
}

/* TỪ DỄ NHẦM LẪN */
.confuse-card {
    margin-top: 16px;
    border-radius: 10px;
    background: #e5f0ff;
    padding: 14px 18px;
    font-size: 18px;
}

.confuse-title {
    font-weight: 700;
    margin-bottom: 6px;
}

/* TABS: PHÂN TÍCH NGỮ PHÁP / NGỮ CẢNH */
.tabs-card {
    margin-top: 18px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
    font-size: 18px;
}

.tabs-header {
    display: flex;
}

.tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    border: none;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.tab + .tab {
    border-left: 1px solid #e5e7eb;
}

.tab.active {
    background: #2563eb;
    color: #fff;
    border-bottom-color: transparent;
}

.tab-body {
    padding: 12px 18px 16px;
    background: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* CA DAO, TỤC NGỮ, THÀNH NGỮ */
.proverb-card {
    margin-top: 22px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 16px 20px;
}

.proverb-title {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 12px;
}

.proverb-section {
    margin-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 30px;
}

.proverb-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.proverb-section-title {
    background: #f3f4f6;
    padding: 6px 10px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 6px;
    display: inline-block;
}

.link-detail {
    font-size: 18px;
    color: #2563eb;
    cursor: pointer;
    float: right;
}

/* BÀI VIẾT LIÊN QUAN */
.related-card {
    margin-top: 22px;
    border-radius: 12px;
    padding: 16px 20px;
    background: #f9fafb;
}

.related-title {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 12px;
}

.related-item {
    padding: 10px;
    border-radius: 8px;
    background: #e5f0ff;
    margin-bottom: 8px;
}

.related-index {
    background: #2563eb;
    color: #fff;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    margin-right: 8px;
}

.related-item > .related-index {
    float: left;
}

.related-item {
    position: relative;
    padding-left: 38px;
}

.related-desc {
    font-size: 18px;
    color: #6b7280;
    margin-top: 4px;
}

/* TỪ LIÊN QUAN + FOOTER ACTIONS */
.related-words-title {
    margin-top: 18px;
    font-weight: 600;
    font-size: 18px;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.tag-item {
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 18px;
}

.footer-actions {
    margin-top: 18px;
    font-size: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #2563eb;
}

.footer-actions span {
    cursor: pointer;
}

.footer-actions .report {
    color: #dc2626;
}

/* SIDEBAR */
.sidebar-card {
    padding: 10px 0;
    position: sticky;
    top: 0;
    right: 0;
}

.sidebar-title {
    color: #424242;
    padding: 0 16px 10px 0;
    font-size: 24px;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    padding: 9px 16px;
    font-size: 18px;
    cursor: pointer;
    background: #F5F5F5;
    margin-bottom: 8px;
    border-radius: 8px;
}

.sidebar-item:first-of-type {
    border-top: none;
}

.sidebar-item.active {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(315deg, #1270E3 0%, #59C2FF 100%) !important;
}

.sidebar-item:hover:not(.active) {
    background: #e5f0ff;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .page {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 900px) {
    .content {
        flex-direction: column;
    }

    .side-column {
        order: -1;
    }

    .main-layout-top {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 16px 14px 24px;
    }

    .header-title {
        font-size: 22px;
    }

    .word-title {
        font-size: 24px;
    }

    .search-button {
        padding-inline: 14px;
        font-size: 18px;
    }
}


/* HERO HEADER */

.hero-header {
    background: #FFFFFF;
    padding: 20px 0 20px 0;
    margin: 30px auto;
    max-width: 100vw;
    width: 80%;
    border-radius: 10px;
}

.hero-inner {
    padding: 0 16px;
    position: relative;
}

/* Thanh search */
.hero-search {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid #E0E0E0;
    overflow: hidden;
}

input.hero-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 18px;
    font-size: 15px;
}

.hero-search-btn {
    border: none;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(315deg, #1270E3 0%, #59C2FF 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-radius: 999px;
    margin: 6px; /* tạo border trắng mỏng quanh nút như hình */
}

.hero-search-icon {
    font-size: 16px;
}

/* “Ảnh” phía dưới – tạm thời là block màu, bạn có thể đổi thành img */
.hero-illustration {
    margin-top: 10px;
    height: 30px;
    border-radius: 12px;


    /* nếu chưa có ảnh thì dùng màu tạm: */
    /* background: linear-gradient(135deg, #f9a8d4, #facc15); */
}

/* Responsive */

@media (max-width: 640px) {
    .hero-title {
        font-size: 24px;
    }

    .hero-search-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .hero-search-btn {
        padding: 4px 16px;
        font-size: 13px;
        position: absolute;
        right: 17px;
        top: 0;
    }

    .hero-illustration {
        height: 60px;
    }
}
.page strong,.page b {
    font-family: "Nunito", sans-serif;
}

.vdict-top-banner {
    background: url("/themes/images/vdict/bg-header-vdict.png") top left/cover no-repeat;
    height: 320px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding-top: 30px;
}

.vdict-top {
    background: url("/themes/images/vdict/banner-header-vdict.png") top left/cover no-repeat;
    height: 187px;
    width: 915px;
    max-width: 915px;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .vdict-top {
        background: url("/themes/images/vdict/top-vdict-mb.png") top left/cover no-repeat;
        width: 90%;
        height: auto;
        min-height: 144px;
        max-width: 100vw;
        margin: 0 auto;
        box-sizing: border-box;
    }
}

.popular-keywords-section {
    display: flex; /* Sắp xếp tiêu đề và danh sách từ khóa trên cùng một hàng */
    align-items: center; /* Căn giữa theo chiều dọc */
    gap: 15px; /* Khoảng cách giữa tiêu đề và thẻ đầu tiên */
    margin-top: 15px;
}

.section-title {
    color: #333333; /* Màu chữ tiêu đề */
    font-size: 16px;
    margin-top: 4px;
    font-weight: 700;
}

.keyword-list {
    display: flex;
    gap: 10px; /* Khoảng cách giữa các thẻ từ khóa */
}

.keyword-chip {
    /* Hình dạng và màu sắc của thẻ */
    background-color: #e0e0e0; /* Màu nền xám nhạt */
    color: #424242; /* Màu chữ */
    padding: 4px 16px; /* Padding cho thẻ */
    border-radius: 50px; /* Tạo hình bầu dục/pill shape */
    font-size: 16px;
    font-weight: 700;
    cursor: pointer; /* Thêm con trỏ để gợi ý rằng đây là các nút có thể tương tác */
    transition: background-color 0.2s; /* Hiệu ứng chuyển đổi mượt mà khi hover */
    white-space: nowrap; /* Ngăn từ khóa bị ngắt dòng */
}

.keyword-chip:hover {
    background-color: #d0d0d0; /* Thay đổi màu khi di chuột */
}

/* Thiết lập chung cho body và container */

.container {

}

/* --- Khối Thông báo lỗi (Phần trên) --- */
.error-message-box {
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
    margin: 20px auto 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
    padding: 24px 28px 32px;
    color: #111827;
    line-height: 1.5;

    text-align: center;
    margin-bottom: 20px;
}

.icon-container {
    margin-bottom: 20px;
}

.error-icon {
    display: inline-block;
    width: 60px; /* Kích thước biểu tượng */
    height: 60px;
    /* Mô phỏng biểu tượng dấu X màu đỏ */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23dc3545" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>') no-repeat center center;
    background-size: contain;
}

.error-message-box .h1 {
    font-size: 1.5em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: bold;
}

.error-message-box p {
    font-size: 1em;
    color: #666;
    line-height: 1.5;
}

/* --- Khối Gợi ý từ khóa (Phần dưới) --- */
.suggestion-box {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px 30px; /* Padding phù hợp với hình ảnh */
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
    margin: 20px auto 40px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
    color: #111827;
    line-height: 1.5;
}

.suggestion-title {
    font-weight: bold;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}

.keywords {
    display: flex;
    flex-wrap: wrap; /* Cho phép các từ khóa xuống dòng */
    gap: 10px 20px; /* Khoảng cách giữa các từ khóa (dọc và ngang) */
    align-items: flex-start;
}

.keyword {
    text-decoration: none; /* Bỏ gạch chân */
    color: #007bff; /* Màu xanh dương như liên kết */
    font-size: 0.95em;
    white-space: nowrap; /* Ngăn từ khóa bị ngắt dòng */
}

.keyword:hover {
    text-decoration: underline;
}

/* Điều chỉnh khoảng cách bên dưới khối nội dung để phù hợp với hình ảnh */
.error-message-box p:last-of-type {
    margin-bottom: 0;
}

/* === CSS cho Phần 2: Lưới 4 ô (Card Grid) === */
.card-grid {
    display: grid;
    /* Tạo 2 cột có kích thước bằng nhau */
    grid-template-columns: repeat(2, 1fr);
    gap: 20px; /* Khoảng cách giữa các card */
    width: 100%;
    max-width: 915px;x
    box-sizing: border-box;
    margin: 30px auto;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 25px; /* Padding bên trong card */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none; /* Loại bỏ gạch chân cho liên kết */
    transition: box-shadow 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.card img {
    width: 120px;
    height: auto;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* Hiệu ứng nổi lên khi hover */
    text-decoration: none;
}

.card:hover h2 {
    color: #1270E3;
}

.card-image-placeholder {
    /* Đây là nơi đặt style cho khu vực ảnh minh họa */
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    /* Dùng để hiển thị các image tag như bạn thấy trong hình */
    /* Trong thực tế, bạn sẽ dùng thẻ <img> */
    /* Mô phỏng việc căn chỉnh ảnh */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8em;
}

.card h2 {
    font-size: 24px;
    font-weight: 900;
    color: #424242; /* Màu xanh nổi bật như trong hình */
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    font-size: 16px;
    font-weight: 500;
    color: #636363;
    line-height: 1.5;
    margin-bottom: 0;
}

/* CSS cho thiết bị di động (Responsive) */
@media (max-width: 768px) {
    .card-grid {
        /* Chuyển sang 1 cột trên màn hình nhỏ */
        grid-template-columns: 1fr;
    }
}