/* SOFT BRUTALISM UI - SPELLING CHECKER */
.brutal-tool-wrapper {
    max-width: 800px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, sans-serif;
    color: #111;
}

.brutal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.brutal-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.word-counter {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 4px 12px;
    background: #e8e8e8;
    border: 2px solid #111;
    border-radius: 8px;
    box-shadow: 2px 2px 0px #111;
}

.word-counter.limit-reached {
    background: #ffb3b3;
    color: #cc0000;
}

.brutal-editor-container {
    position: relative;
    margin-bottom: 24px;
}

#spell-editor {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
    background: #fdfdfc;
    border: 3px solid #111;
    border-radius: 12px;
    box-shadow: 6px 6px 0px #111;
    outline: none;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

#spell-editor:focus {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px #111;
}

#spell-editor:empty:before {
    content: attr(placeholder);
    color: #888;
    pointer-events: none;
}

/* HIỆU ỨNG TỪ SAI */
.spell-error {
    background-color: #ffc2c2;
    border-bottom: 2px solid #e60000;
    border-radius: 3px;
    cursor: pointer;
    padding: 0 2px;
    transition: background 0.2s;
}

.spell-error:hover {
    background-color: #ff9999;
}

/* NÚT THAO TÁC */
.brutal-actions {
    display: flex;
    gap: 16px;
}

.brutal-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    border: 3px solid #111;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #111;
    transition: all 0.1s ease;
}

.brutal-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #111;
}

.brutal-btn.primary { background: #d4f2a3; }
.brutal-btn.secondary { background: #fff; }

/* BẢNG GỢI Ý CHUẨN BRUTAL */
.brutal-popover {
    position: absolute;
    top: 0; left: 0;
    background: #fff;
    border: 3px solid #111;
    box-shadow: 5px 5px 0px #111;
    border-radius: 8px;
    padding: 12px;
    width: 200px;
    z-index: 100;
    display: none;
}

.popover-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 8px;
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.sugg-item {
    background: #e6f7ff;
    border: 2px solid #111;
    border-radius: 6px;
    padding: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s;
}

.sugg-item:hover { background: #bae7ff; }

.btn-ignore {
    width: 100%;
    padding: 6px;
    background: #ffeaea;
    border: 2px solid #111;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.btn-ignore:hover { background: #ffcccc; }
/* HIỆU ỨNG TỪ SAI */
.spell-error {
    border-radius: 3px;
    cursor: pointer;
    padding: 0 2px;
    transition: background 0.2s;
}

/* Lỗi Lượt 1: Sai từ đơn (Màu đỏ) */
.spell-error.type-single {
    background-color: #ffc2c2;
    border-bottom: 2px solid #e60000;
}
.spell-error.type-single:hover {
    background-color: #ff9999;
}

/* Lỗi Lượt 2: Sai ngữ cảnh/Từ ghép (Màu cam) */
.spell-error.type-compound {
    background-color: #ffe8b3; 
    border-bottom: 2px solid #ff9900;
}
.spell-error.type-compound:hover {
    background-color: #ffd699;
}