#flag-icon {
    position: absolute;
    display: none;
    cursor: pointer;
    font-size: 24px;
}

#fong-dictionary-popup {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    /*    border-radius: 8px; /* Thêm bo tròn */
}

.fong-spinner {
    width: 20px;
    height: 20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Styles cho popup */
.fong-popup-tu-dien {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    color: #333;
    /* text-align: center; */
    padding: 20px;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transition: bottom 0.3s ease-in-out;
    z-index: 9999;
    max-width: 100%;
    width: 500px;
    min-height: 85px;
}

/* Định dạng cho nội dung trong popup */
.fong-popup-tu-dien p {
    margin: 0 0 15px;
    font-size: 16px;
    display: flex;
}

/* Định dạng cho icon trong popup */
.fong-popup-tu-dien p i {
    margin-right: 10px;
    font-size: 24px;
}

/* Định dạng cho nút trong popup */
.fong-tu-dien-popup-close {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Hiệu ứng hover cho nút popup */
.fong-tu-dien-popup-close:hover {
    background-color: #0056b3;
}

/* Styles cho overlay */
.fong-tu-dien-overlay-active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
    visibility: visible;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Media queries cho responsive */
@media (max-width: 768px) {
    .fong-popup-tu-dien {
        margin: 0 auto;
    }
}

/* Hiển thị popup */
.fong-popup-tu-dien.show {
    bottom: 100px;
}


.fong_word-not-found p strong {
    margin: auto 5px;
}


/* 2024-12-15  */
/* Thêm styles cho phần từ điển */
.fong-dictionary-functionality {
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
}

.fong-dictionary-title {
    font-size: 28px;
    color: #0066cc;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.fong-dictionary-search-container {
    margin-bottom: 20px;
    position: relative;
}

.fong-dictionary-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fong-dictionary-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
    outline: none;
}

.fong-dictionary-search-type-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
}

.fong-dictionary-search-type-button {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 15px;
    border: 2px solid #0066cc;
    background: transparent;
    color: #0066cc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.fong-dictionary-search-type-button:hover {
    background: #0066cc;
    color: #ffffff;
}

.fong-dictionary-search-type-button.fong-dictionary-active {
    background: #0066cc;
    color: #ffffff;
}

.fong-dictionary-search-type-button.fong-dictionary-active:hover {
    background: #005bb9;
    border-color: #005bb9;
    color: #ffffff;
}

.fong-dictionary-search-type-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Styles cho phần skeleton loading */
.fong-dictionary-skeleton {
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 8px;
    /* border: 1px solid #e0e0e0; */
    margin-top: 20px;
}

.fong-dictionary-skeleton__loader {
    animation: fong-dictionary-loading 1.5s infinite;
}

/* Dòng lớn ở trên */
.fong-dictionary-skeleton__word {
    height: 28px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: fong-dictionary-loading-wave 2s infinite;
    margin-bottom: 15px;
    border-radius: 4px;
    width: 45%;
}

/* Các dòng nhỏ ở dưới */
.fong-dictionary-skeleton__line {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: fong-dictionary-loading-wave 2s infinite;
    margin-bottom: 12px;
    border-radius: 3px;
}

/* Độ rộng khác nhau cho các dòng */
.fong-dictionary-skeleton__line:nth-child(2) {
    width: 100%;
}

.fong-dictionary-skeleton__line:nth-child(3) {
    width: 90%;
}

.fong-dictionary-skeleton__line:nth-child(4) {
    width: 95%;
}

.fong-dictionary-skeleton__line:nth-child(5) {
    width: 80%;
    margin-bottom: 0;
}

@keyframes fong-dictionary-loading-wave {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fong-dictionary-skeleton {
        padding: 12px 15px;
    }

    .fong-dictionary-skeleton__word {
        height: 24px;
        margin-bottom: 12px;
    }

    .fong-dictionary-skeleton__line {
        height: 16px;
        margin-bottom: 10px;
    }

    .fong-dictionary-skeleton__line:last-child {
        margin-bottom: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fong-dictionary-title {
        font-size: 24px;
    }

    .fong-dictionary-search-type-container {
        gap: 8px;
    }

    .fong-dictionary-search-type-button {
        min-width: 100px;
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* Thêm hiệu ứng focus cho input trên mobile */
@media (max-width: 480px) {
    .fong-dictionary-input:focus {
        transform: translateY(-2px);
    }

    .fong-dictionary-search-type-container {
        flex-direction: column;
        gap: 10px;
    }

    .fong-dictionary-search-type-button {
        width: 100%;
    }
}


.fong-dictionary-result {
    margin-top: 1em;
}

.fong-dictionary-input:disabled {
    background-color: #f5f5f5;
    opacity: 0.8;
    cursor: not-allowed;
}

.fong-dictionary-cache-info {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
    color: #666;
    font-size: 12px;
    font-family: monospace;
}

.fong-dictionary-cache-info span {
    margin-right: 8px;
}

.fong-dictionary-cache-info span:first-child {
    color: #0066cc;
    font-weight: bold;
}

.fong-dictionary-warning {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1em;

}

.fong-dictionary-warning i {
    font-size: 20px;
    color: #856404;
}

.fong-dictionary-warning p {
    margin: 0;
}

/* Hiệu ứng shake */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* Styles cho container từ vựng theo chủ đề */
.fong-tu-vung-theo-chu-de-container {
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
}

/* Style cho mỗi chủ đề */
.fong-chu-de-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fong-chu-de-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Style cho tiêu đề chủ đề */
.fong-chu-de-title {
    font-size: 24px;
    color: #0066cc;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
}

/* Style cho danh sách từ vựng */
.fong-tu-vung-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Style cho mỗi từ vựng */
.fong-tu-vung-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 15px;
    color: #333;
}

.fong-tu-vung-item:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
    transform: translateX(5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fong-tu-vung-theo-chu-de-container {
        /* Xóa padding: 15px; */
        /* Xóa margin: 10px; */
    }

    .fong-chu-de-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .fong-tu-vung-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }

    .fong-tu-vung-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    /* Reset các style mặc định của WordPress cho danh sách */
    .fong-tu-vung-list,
    .entry-content .fong-tu-vung-list,
    .fong-tu-vung-list:not(.blocks-gallery-grid):not(.wp-block-gallery) {
        padding: 0 !important;
        padding-left: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .fong-chu-de-item {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* Chuyển sang 1 cột cho mobile và căn giữa */
    .fong-tu-vung-list {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto !important; /* Force override */
    }

    .fong-tu-vung-item {
        text-align: center;
        padding: 12px 35px 12px 15px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        /* Reset các style mặc định */
        margin: 0 !important;
        list-style-type: none !important;
    }

    /* Điều chỉnh mũi tên */
    .fong-tu-vung-item::after {
        content: '›';
        position: absolute;
        right: 15px;
        font-size: 20px;
        color: #0066cc; /* Đổi màu mũi tên */
        transition: all 0.3s ease;
    }

    /* Hiệu ứng hover */
    .fong-tu-vung-item:hover {
        background: #0066cc;
        color: #fff;
        transform: translateX(0); /* Bỏ transform sang phải */
        transform: scale(1.02); /* Thay bằng hiệu ứng scale nhẹ */
    }

    /* Căn giữa tiêu đề */
    .fong-chu-de-title {
        text-align: center;
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* Điều chỉnh nút toggle */
    .fong-tu-vung-toggle-btn {
        max-width: 320px; /* Giới hạn chiều rộng tối đa */
        margin: 15px auto 0; /* Căn giữa nút */
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* Màn hình siêu nhỏ */
@media (max-width: 320px) {
    .fong-tu-vung-list,
    .fong-tu-vung-toggle-btn {
        max-width: 280px;
    }

    /* Reset thêm một lần nữa cho chắc chắn */
    .fong-tu-vung-list,
    .entry-content .fong-tu-vung-list {
        padding: 0 !important;
        margin: 0 auto !important;
    }

    .fong-tu-vung-item {
        font-size: 15px;
        padding: 10px 30px 10px 12px;
    }
}

/* Animation khi hover */
@keyframes fong-tu-vung-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.fong-tu-vung-item:active {
    animation: fong-tu-vung-pulse 0.3s ease;
}

/* Style cho nút xem thêm/thu gọn */
.fong-tu-vung-toggle-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-top: 15px;
    background: transparent;
    border: 2px solid #0066cc;
    border-radius: 6px;
    color: #0066cc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.fong-tu-vung-toggle-btn:hover {
    background: #0066cc;
    color: #fff;
}

.fong-tu-vung-toggle-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.fong-tu-vung-toggle-btn:not(.active) i {
    transform: rotate(0deg);
}

.fong-tu-vung-toggle-btn.active i {
    transform: rotate(-180deg);
}

/* Style cho danh sách từ vựng khi thu gọn */
.fong-tu-vung-list.collapsed {
    max-height: 280px; /* Điều chỉnh để vừa đủ cho 10 từ */
    overflow: hidden;
}

/* Style cho tiêu đề chính của từ vựng */
.fong-vocabulary-title {
    font-size: 28px;
    color: #0066cc;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

/* Responsive cho tiêu đề */
@media (max-width: 768px) {
    .fong-vocabulary-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .fong-vocabulary-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

.fong-dictionary-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 40px 0;
}

.fong-dictionary-hr {
    flex-grow: 1;
    border: none;
    height: 1px;
    background: #e0e0e0;
    margin: 0;
}

.fong-dictionary-divider-text {
    padding: 0 20px;
    color: #666;
    font-size: 14px;
    text-transform: lowercase;
}



