﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

main.content {
    height: 100vh;
    padding: 0;
}

    main.content nav {
        padding: 15px !important;
        border-radius: 0;
        box-shadow: 0 1px 4px 0 rgb(0 0 0 / 38%);
        z-index: 99;
    }
    main.content .main-body-container {
        overflow: auto;
    }
    main.content footer {
        border-radius: 0 !important;
        box-shadow: 0 1px 4px 0 rgb(0 0 0 / 38%) !important;
    }

.dataTables_length select.form-select {
    min-width: 70px;
}


.select2-selection {
    height: 40px !important;
    padding: 5px;
    border-radius: 5px !important;
}
    .select2-selection .select2-selection__arrow {
        height: 40px !important;
        top: 0px;
    }

.table tbody tr td {
    vertical-align: middle;
}
mark {
    background: yellow;
    color: black;
    padding: 0 2px;
    border-radius: 3px;
}
.table {
    font-size: 0.9rem;
}
.table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}
.table tr.selected {
    background-color: #d0ebff !important;
}
/* Giới hạn chiều rộng cột Message nhưng vẫn cho xuống dòng */
    .table.table-wrap td, .table.table-wrap th {
        white-space: normal; /* Cho phép xuống dòng */
        word-break: break-word; /* Ngắt từ khi quá dài */
        height: auto; /* Auto co giãn chiều cao */
        text-overflow: ellipsis; /* Hiển thị ... nếu dài quá */
    }

    .table .col-message {
        max-width: 400px; /* Giới hạn chiều rộng cột Message */
    }
#logDetailModalBody pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.menu-open .link-arrow {
    transform: rotate(90deg) !important;
    transition: transform 0.3s ease !important;
}
.collapsed .link-arrow {
    transform: none !important;
    transition: transform 0.3s ease !important;
}
.article-action-top {
    z-index: 98;
}
.btn {
    box-shadow: 1px 2px 2px rgb(187 187 187), inset 1px 1px 1px rgb(243 243 243) !important;
}
.badge {
    padding: 10px;
    border-radius: 50px;
    box-shadow: 1px 1px 3px rgb(171 171 171), inset 1px 1px 2px rgb(243 243 243) !important;
}

.ck-editor__main .ck-content.ck-editor__editable {
    min-height: 480px;
}
.ck-powered-by {
    display: none;
}
.ck-content img {
    max-width: 100%;
    height: auto;
}
.dataTables_wrapper .dt-row {
    overflow: auto !important;
}

/* ====== Base container ====== */
.tags-input {
    --ti-bg: #fff;
    --ti-border: #d0d7de;
    --ti-border-focus: #6ea8fe;
    --ti-text: #111827;
    --ti-placeholder: #94a3b8;
    --ti-chip-bg: #eef2ff;
    --ti-chip-text: #1e293b;
    --ti-chip-x: #475569;
    --ti-chip-x-hover: #0f172a;
    --ti-shadow-focus: 0 0 0 3px rgba(99, 102, 241, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    max-height: 160px; /* có thể tăng nếu muốn */
    overflow-y: auto; /* scroll khi quá cao */
    padding: 6px 8px;
    border: 1px solid var(--ti-border);
    border-radius: 10px;
    background: var(--ti-bg);
    color: var(--ti-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .2s ease;
}

    /* Focus trạng thái khi input con nhận focus */
    .tags-input:focus-within {
        border-color: var(--ti-border-focus);
        box-shadow: var(--ti-shadow-focus);
    }

    /* ====== Tag chip ====== */
    .tags-input .tag {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        max-width: 100%;
        padding: 6px 10px;
        border-radius: 999px;
        background: var(--ti-chip-bg);
        color: var(--ti-chip-text);
        font-size: 13px;
        line-height: 1;
        user-select: none;
        white-space: nowrap;
    }

        .tags-input .tag .label {
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Nút xóa “x” */
        .tags-input .tag .remove {
            display: inline-grid;
            place-items: center;
            width: 16px;
            height: 16px;
            border: none;
            border-radius: 50%;
            font-size: 12px;
            font-weight: bold;
            line-height: 1;
            cursor: pointer;
            color: #333333;
            background: #bfbfbf;
            transition: background-color .15s ease, color .15s ease, transform .08s ease-in-out;
            padding: 0px 1px 1px 1px;
        }

            .tags-input .tag .remove:hover {
                background: rgba(15, 23, 42, 0.08);
                color: var(--ti-chip-x-hover);
            }

            .tags-input .tag .remove:active {
                transform: scale(0.9);
            }

    /* ====== Input field ====== */
    .tags-input > input[type="text"] {
        flex: 1 0 140px; /* đủ rộng, nhưng có thể thu nhỏ */
        min-width: 120px;
        border: none;
        outline: none;
        background: transparent;
        color: var(--ti-text);
        font-size: 14px;
        line-height: 1.4;
        padding: 6px 4px;
    }

    /* Placeholder style */
    .tags-input > input::placeholder {
        color: var(--ti-placeholder);
    }

    /* Khi container disabled */
    .tags-input.is-disabled,
    .tags-input[aria-disabled="true"] {
        opacity: 0.65;
        pointer-events: none;
    }

    /* Trạng thái invalid (ví dụ quá số lượng tag, tag trùng, v.v.) */
    .tags-input.is-invalid {
        border-color: #ef4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    }

    /* ====== Compact size (tùy chọn) ====== */
    .tags-input.is-compact {
        min-height: 34px;
        padding: 4px 6px;
    }

        .tags-input.is-compact .tag {
            padding: 4px 8px;
            font-size: 12px;
        }

        .tags-input.is-compact > input[type="text"] {
            padding: 4px 2px;
            font-size: 13px;
        }

/* ====== Dark mode cơ bản (ưu tiên theo data-theme) ====== */
[data-theme="dark"] .tags-input {
    --ti-bg: #0b1220;
    --ti-border: #273449;
    --ti-border-focus: #70b8ff;
    --ti-text: #e5e7eb;
    --ti-placeholder: #64748b;
    --ti-chip-bg: #1b2333;
    --ti-chip-text: #e5e7eb;
    --ti-chip-x: #aab4c4;
    --ti-chip-x-hover: #ffffff;
}

/* ====== Hỗ trợ RTL (nếu cần) ====== */
[dir="rtl"] .tags-input {
    direction: rtl;
}

    [dir="rtl"] .tags-input .tag {
        direction: rtl;
    }

/* Giới hạn chiều cao của modal và cho phép cuộn bên trong */
.modal-dialog {
    max-height: calc(100vh - 50px); /* cách top-bottom 20px */
}

.modal-content {
    max-height: calc(100vh - 50px);
    overflow: hidden;
}

/* Body cuộn được */
.modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    /* trừ header ~60px + footer ~60px + margin */
}

select.form-select option {
    padding: 8px;
    background: #fff;
    color: #333;
    font-size: 15px;
}
    select.form-select option:hover {
        background: #e9ecef !important;
    }
    select.form-select option:checked {
        background: #6f42c1;
        color: #fff;
    }
