/* ========================================================
   Admin Console Custom Styles - Logo & Professional Layout
   ======================================================== */

/* Logo Keycloak goc tren ben trai */
.pf-v5-c-brand,
.pf-c-brand,
.pf-v5-c-masthead__brand img,
.pf-c-masthead__brand img,
.keycloak__masthead__brand,
a.pf-v5-c-masthead__brand > img,
a.pf-c-masthead__brand > img {
    content: url("../img/tayninh.svg") !important;
    max-height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
}

.pf-v5-c-masthead__brand,
.pf-c-masthead__brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* ========================================================
   Sua bo cuc Form Group & File Upload 100% chieu ngang
   ======================================================== */

/* Khung chua Control phai theo chieu doc (COLUMN), rong 100% */
.pf-v5-c-form__group-control {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* File Upload Component: rong 100% theo chieu doc */
.pf-v5-c-file-upload {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Thanh nhap lieu va nut bam (Input Group) nam tren 1 hang ngang 100% */
.pf-v5-c-file-upload .pf-v5-c-input-group {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
}

/* O input ten file: gian rong 100% toan bo khoang trong */
.pf-v5-c-file-upload .pf-v5-c-input-group > div:first-child,
.pf-v5-c-file-upload .pf-v5-c-input-group__item:first-of-type,
.pf-v5-c-file-upload .pf-v5-c-input-group__item.pf-m-fill {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
}

.pf-v5-c-file-upload input.pf-v5-c-form-control {
    width: 100% !important;
    min-width: 0 !important;
}

/* Khung boc cac nut bam: co dinh theo noi dung, khong bi ep co lai */
.pf-v5-c-file-upload .pf-v5-c-input-group > div:not(:first-child),
.pf-v5-c-file-upload .pf-v5-c-input-group__item:not(:first-of-type) {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: auto !important;
}

/* Dinh dang cac nut bam trong File Upload */
.pf-v5-c-file-upload button,
.pf-v5-c-file-upload .pf-v5-c-button {
    flex-shrink: 0 !important;
    width: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 14px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    height: 100% !important;
}

/* Nut Tim kiem */
.pf-v5-c-file-upload .pf-v5-c-input-group > div:nth-child(2) button,
.pf-v5-c-file-upload .pf-v5-c-input-group__item:nth-of-type(2) button {
    min-width: 95px !important;
}

/* Nut Xoa */
.pf-v5-c-file-upload .pf-v5-c-input-group > div:nth-child(3) button,
.pf-v5-c-file-upload .pf-v5-c-input-group__item:nth-of-type(3) button {
    min-width: 65px !important;
}

/* Khung Code Editor xem truoc JSON ben duoi: rong 100% */
.pf-v5-c-file-upload .pf-v5-c-code-editor,
.pf-v5-c-file-upload .pf-v5-c-code-editor__main {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px !important;
    border-radius: 6px !important;
}

/* Helper Text nam o dong duoi cung cua Form Group */
.pf-v5-c-form__helper-text,
.pf-v5-c-form__group-control > .pf-v5-c-helper-text {
    width: 100% !important;
    margin-top: 8px !important;
    display: block !important;
}



/* ========================================================
   An cac nut chuyen huong ra ben ngoai (Documentation / Guide / Community)
   ======================================================== */

/* An tat ca cac lien ket chuyen huong ra ngoai keycloak.org, github, docs, guides, discussions */
a[href*="keycloak.org"],
a[href*="github.com/keycloak"],
a[href*="documentation"],
a[href*="guides"],
a[target="_blank"][href*="http"],
a.pf-v5-c-button.pf-m-link[target="_blank"],
a.pf-c-button.pf-m-link[target="_blank"],
.pf-v5-c-card__footer a[target="_blank"],
.pf-v5-c-empty-state__body a[target="_blank"],
.pf-v5-c-masthead__tools a[href*="docs"],
.pf-v5-c-masthead__tools a[href*="guide"],
.pf-v5-c-dropdown__menu-item[href*="keycloak.org"],
button[aria-label="Help"],
button[aria-label="Documentation"],
.keycloak-documentation-link,
.pf-v5-c-button.pf-m-link[href*="http"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* Hide Join Community and Read Blog cards and links */
a[href*="community"],
a[href*="blog"],
a[href*="keycloak.org"],
[data-testid*="community"],
[data-testid*="blog"],
.pf-v5-c-card:has(a[href*="community"]),
.pf-v5-c-card:has(a[href*="blog"]),
.pf-c-card:has(a[href*="community"]),
.pf-c-card:has(a[href*="blog"]),
li:has(a[href*="community"]),
li:has(a[href*="blog"]) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}
/* ========================================================
   An tat ca cac doan va lien ket "Learn more" / "Tim hieu them"
   ======================================================== */

a[href*="keycloak.org"],
a[href*="github.com"],
a[href*="documentation"],
a[href*="guides"],
a[target="_blank"],
formattedlink,
.formatted-link,
.pf-v5-c-button.pf-m-link[href*="keycloak"],
a[data-testid*="learnMore"],
.keycloak__learn-more-link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
}
/* ========================================================
   Kich thuoc Khung Tim Kiem (Search Input) - Mo rong chieu ngang
   ======================================================== */

.pf-v5-c-search-input,
.pf-c-search-input,
.pf-v5-c-text-input-group,
.pf-c-text-input-group,
.keycloak-search-input,
.pf-v5-c-toolbar__item:has(.pf-v5-c-search-input),
.pf-v5-c-toolbar__item:has(input[type="search"]),
.pf-v5-c-toolbar__item:has(input[placeholder*="Tìm kiếm"]),
.pf-v5-c-toolbar__item:has(input[placeholder*="Search"]) {
    min-width: 450px !important;
    max-width: 650px !important;
    flex: 1 1 500px !important;
}

.pf-v5-c-search-input input,
.pf-c-search-input input,
.pf-v5-c-search-input__text-input,
.pf-v5-c-text-input-group__text-input {
    min-width: 400px !important;
    width: 100% !important;
}
