/* CSS SOFT BRUTALISM - Outline Generator V4 */

.tool-container {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    border: 3px solid #111111;
    border-radius: 12px;
    box-shadow: 6px 6px 0px #111111;
    padding: 30px;
    color: #111111;
    box-sizing: border-box;
}

.tool-container h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    margin-top: 0;
}

/* SEO Meta Box */
.seo-meta-box {
    background-color: #f4f4f4;
    border: 3px solid #111111;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}
.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #111111;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
    resize: vertical;
}

.input-group input:focus, 
.input-group textarea:focus {
    box-shadow: 4px 4px 0px #111111;
    background-color: #ffffff;
}

.divider {
    border: none;
    border-top: 3px dashed #111111;
    margin: 25px 0;
}

/* Toolbar */
.heading-toolbar {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.heading-toolbar button {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 10px 20px;
    border: 2px solid #111111;
    border-radius: 8px;
    box-shadow: 3px 3px 0px #111111;
    transition: transform 0.1s, box-shadow 0.1s;
    color: #111111;
}

.heading-toolbar button:active {
    transform: translate(3px, 3px);
    box-shadow: 0px 0px 0px #111111;
}

.btn-h1 { background-color: #ffb7b2; }
.btn-h2 { background-color: #b5ead7; }
.btn-h3 { background-color: #cbaacb; }
.btn-h4 { background-color: #ffdac1; }
.btn-h5 { background-color: #fdfd96; }

/* Nút Toggle Bật/Tắt đánh số */
.btn-toggle-num {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    padding: 10px 20px;
    border: 2px solid #111111;
    border-radius: 8px;
    box-shadow: 3px 3px 0px #111111;
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
    color: #111111;
    background-color: #b5ead7; /* Mặc định bật (Xanh) */
    margin-left: auto; /* Đẩy công tắc sang góc phải */
    user-select: none;
    display: inline-block;
}

.btn-toggle-num:active {
    transform: translate(3px, 3px);
    box-shadow: 0px 0px 0px #111111;
}

/* Editor Area */
.editor-area {
    min-height: 400px;
    background-color: #f9f9f9;
    border: 3px solid #111111;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow-x: hidden;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    line-height: 1.6;
    pointer-events: none;
}

/* Từng khối Block */
.block-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 0px #111111;
    transition: transform 0.2s, box-shadow 0.2s;
}

.block-item.dragging {
    opacity: 0.5;
    box-shadow: 6px 6px 0px #111111;
    transform: scale(1.02);
    z-index: 10;
}

.drag-handle {
    cursor: grab;
    font-size: 1.2rem;
    color: #888;
    user-select: none;
    padding: 0 5px;
}
.drag-handle:active { cursor: grabbing; }

.block-level {
    font-weight: 800;
    font-size: 0.9rem;
    background: #111111;
    color: #ffffff;
    padding: 3px 6px;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
}

.block-number {
    font-weight: 700;
    color: #333;
}
/* Giấu khoảng trống nếu không có số (H1 hoặc khi Tắt đánh số) */
.block-number:empty {
    display: none;
}

.block-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    background: transparent;
    padding: 5px;
    font-weight: bold;
}

.btn-delete {
    background: #ffb7b2;
    border: 2px solid #111111;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 8px;
}

/* Chỉnh độ thụt lề trực quan cho 5 cấp */
.block-item[data-level="1"] { margin-left: 0px; }
.block-item[data-level="2"] { margin-left: 0px; } /* H2 là cấp 1 của list */
.block-item[data-level="3"] { margin-left: 25px; }
.block-item[data-level="4"] { margin-left: 50px; }
.block-item[data-level="5"] { margin-left: 75px; }

/* Action Buttons & Toast */
.tool-container .action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.tool-container .action-buttons button {
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 15px 20px;
    border: 3px solid #111111;
    border-radius: 8px;
    box-shadow: 4px 4px 0px #111111;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    color: #111111;
}

.tool-container .action-buttons button:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #111111;
}

.btn-copy { background-color: #97c1a9; }
.btn-clear { background-color: #eceae4; }

#toastOutline {
    visibility: hidden;
    min-width: 250px;
    background-color: #111111;
    color: #ffffff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 9999;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toastOutline.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

@media (max-width: 650px) {
    .btn-toggle-num { margin-left: 0; width: 100%; text-align: center; }
}