/* ==========================================================================
   UD INFOPARK - ACCOUNT TÉMA (V3) - LOGÓ + SZÖVEG ÉS TISZTA MENÜ
   ========================================================================== */

/* 1. A gyári Keycloak logó TÉNYLEGES eltüntetése a DOM-ból */
.pf-v5-c-masthead__brand img {
    display: none !important;
}

/* 2. A konténer beállítása (Helycsinálás a logónak) */
.pf-v5-c-masthead__brand {
    background-image: url('../img/udinfopark_logo.svg') !important;
    background-size: contain !important; /* Megtartja a logó arányait */
    background-repeat: no-repeat !important;
    background-position: left center !important;

    /* Ha a logód szélesebb, ezt a 60px-et nyugodtan növeld meg (pl. 80px-re)! */
    padding-left: 60px !important;

    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    width: auto !important; /* Rugalmas szélesség a szöveg miatt */
}

/* 3. A hófehér UD INFOPARK felirat "beoltása" a HTML-be CSS-en keresztül */
.pf-v5-c-masthead__brand::after {
    content: "UD INFOPARK" !important;
    color: #ffffff !important;        /* Hófehér szín */
    font-size: 20px !important;       /* Betűméret */
    font-weight: 700 !important;      /* Félkövér */
    letter-spacing: 1px !important;   /* Pici ritkítás, hogy elegánsabb legyen */
    white-space: nowrap !important;   /* Ne törje sort, ha kisebb a képernyő */
}

/* ==========================================================================
   4. FELESLEGES MENÜK ELREJTÉSE
   ========================================================================== */
/* Elrejtjük az "Alkalmazások" (Applications) menüpontot */
li.pf-v5-c-nav__item:has(> a[data-testid="applications"]) {
    display: none !important;
}

/* Elrejtjük az "Eszköztevékenység" (Device activity) menüpontot */
li.pf-v5-c-nav__item:has(> a[data-testid="account-security/device-activity"]) {
    display: none !important;
}

/* Elrejtjük a "Kapcsolt fiókok" (Linked accounts) menüpontot */
li.pf-v5-c-nav__item:has(> a[data-testid="account-security/linked-accounts"]) {
    display: none !important;
}

/* ==========================================================================
   5. ELSŐDLEGES ÉS MÓDOSÍTÁS GOMBOK ZÖLDRE FESTÉSE
   ========================================================================== */
.pf-v5-c-button.pf-m-primary,
button[data-testrole="update"] {
    background-color: #054334 !important; /* UD INFOPARK Zöld */
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: opacity 0.2s ease !important;
}

/* Hover (Rámutatás) és Fókusz állapotok */
.pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-button.pf-m-primary:focus,
.pf-v5-c-button.pf-m-primary:active,
button[data-testrole="update"]:hover,
button[data-testrole="update"]:focus,
button[data-testrole="update"]:active {
    background-color: #054334 !important;
    opacity: 0.9 !important;
}

/* ==========================================================================
   6. GLOBÁLIS READ-ONLY ÉS DISABLED MEZŐK "DOBOZOSÍTÁSA"
   Ugyanaz a modern keret, mint az aktívaknál, de finom szürke háttérrel!
   ========================================================================== */

/* 1. Multivalue (többértékű) mezők + / - gombjainak elrejtése */
.pf-v5-c-input-group:has(input[readonly]) .pf-v5-c-button,
.pf-v5-c-input-group:has(input[disabled]) .pf-v5-c-button {
    display: none !important;
}

/* 2. Üres read-only/disabled sorok elrejtése a többértékű mezőknél */
.pf-v5-c-input-group:has(input[readonly][value=""]),
.pf-v5-c-input-group:has(input[disabled][value=""]) {
    display: none !important;
}

/* 3. A PatternFly gyári alsó vonalainak eltüntetése */
.pf-v5-c-form-control:has(input[readonly])::before,
.pf-v5-c-form-control:has(input[disabled])::before,
.pf-v5-c-form-control.pf-m-disabled::before,
.pf-v5-c-form-control:has(textarea[readonly])::before,
.pf-v5-c-form-control:has(textarea[disabled])::before,
.pf-v5-c-form-control:has(input[readonly])::after,
.pf-v5-c-form-control:has(input[disabled])::after,
.pf-v5-c-form-control.pf-m-disabled::after,
.pf-v5-c-form-control:has(textarea[readonly])::after,
.pf-v5-c-form-control:has(textarea[disabled])::after {
    display: none !important;
}

/* 4. A MODERN LEKEREKÍTETT KERET RÁHÚZÁSA A LETILTOTT KONTÉNEREKRE */
.pf-v5-c-form-control:has(input[readonly]),
.pf-v5-c-form-control:has(input[disabled]),
.pf-v5-c-form-control.pf-m-disabled,
.pf-v5-c-form-control:has(textarea[readonly]),
.pf-v5-c-form-control:has(textarea[disabled]) {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden !important;
    cursor: default !important;           /* <--- EZT ADTUK HOZZÁ: Normál egérnyíl a dobozon */
}

/* 5. Maga a beviteli mező szövege (Zöld szín és tágas térköz) */
input[readonly]:not([type="radio"]):not([type="checkbox"]),
input[disabled]:not([type="radio"]):not([type="checkbox"]),
textarea[readonly],
textarea[disabled] {
    background-color: transparent !important;
    color: #117b44 !important;
    -webkit-text-fill-color: #117b44 !important;
    opacity: 1 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 14px !important;
    border: none !important;
    box-shadow: none !important;
    cursor: default !important;           /* <--- CSERÉLVE: Normál egérnyíl a szövegen is */
    pointer-events: none !important;
}

/* ==========================================================================
   6/B. KIVÉTELES READ-ONLY MEZŐK (host, user_groups, mailAlternateAddress)
   "DOBOZOSÍTÁSA" ÉS LETILTÁSA
   ========================================================================== */

/* 1. Gombok (+ Hozzáadás és - Törlés) elrejtése */
.pf-v5-c-form__group:has(input[name*="attributes.host"]) .pf-v5-c-button,
.pf-v5-c-form__group:has(input[name*="attributes.user_groups"]) .pf-v5-c-button,
.pf-v5-c-form__group:has(input[name*="attributes.mailAlternateAddress"]) .pf-v5-c-button {
    display: none !important;
}

/* 2. Üres sorok elrejtése a multivalue mezőknél */
.pf-v5-c-input-group:has(input[name*="attributes.host"][value=""]),
.pf-v5-c-input-group:has(input[name*="attributes.user_groups"][value=""]),
.pf-v5-c-input-group:has(input[name*="attributes.mailAlternateAddress"][value=""]) {
    display: none !important;
}

/* 3. A PatternFly alsó vonalainak eltüntetése */
.pf-v5-c-form-control:has(input[name*="attributes.host"])::before,
.pf-v5-c-form-control:has(input[name*="attributes.user_groups"])::before,
.pf-v5-c-form-control:has(input[name*="attributes.mailAlternateAddress"])::before,
.pf-v5-c-form-control:has(input[name*="attributes.host"])::after,
.pf-v5-c-form-control:has(input[name*="attributes.user_groups"])::after,
.pf-v5-c-form-control:has(input[name*="attributes.mailAlternateAddress"])::after {
    display: none !important;
}

/* 4. A szürke keretes doboz ráhúzása */
.pf-v5-c-form-control:has(input[name*="attributes.host"]),
.pf-v5-c-form-control:has(input[name*="attributes.user_groups"]),
.pf-v5-c-form-control:has(input[name*="attributes.mailAlternateAddress"]) {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

/* 5. A beviteli mező átalakítása zöld, kattinthatatlan szöveggé */
input[name*="attributes.host"],
input[name*="attributes.user_groups"],
input[name*="attributes.mailAlternateAddress"] {
    background-color: transparent !important;
    color: #117b44 !important;
    -webkit-text-fill-color: #117b44 !important;
    opacity: 1 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 14px !important;
    border: none !important;
    box-shadow: none !important;
    cursor: default !important;
    pointer-events: none !important;
}

/* ==========================================================================
   7. NORMÁL BEJELENTKEZÉS SZEKCIÓ "KÁRTYÁSÍTÁSA" ÉS TISZTÍTÁSA
   ========================================================================== */

/* A szekció kártyásítása */
section:has(> #basic-authentication-categ-title) {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
}

/* Cím felső margójának nullázása */
#basic-authentication-categ-title {
    margin-top: 0 !important;
}

/* A felesleges kisbetűs "jelszó" felirat teljes eltüntetése */
h3[data-testid="password/help"] {
    display: none !important;
}

/* A megmaradó "Bejelentkezés jelszó segítségével." leírás finomhangolása */
span[data-testid="password/help-text"] {
    display: block !important;
    color: #6a6e73 !important;      /* Szolidabb szürke szín */
    margin-bottom: 16px !important; /* Pici térköz lefelé */
}

/* ==========================================================================
   8. SZEKCIÓK "KÁRTYÁSÍTÁSA" (Új attribútum csoportok alapján)
   ========================================================================== */
section:has(> h1[id="általános"]),
section:has(> h1[id="fiókadatok-és-beállítások"]),
section:has(> h1[id="személyes-adatok"]),
section:has(> h1[id="elérhetőségek"]),
section:has(> h1[id="egyetemi-és-intézményi-adatok"]),
section:has(> h1[id="general"]),
section:has(> h1[id="account-settings"]),
section:has(> h1[id="personal-information"]),
section:has(> h1[id="contact-information"]),
section:has(> h1[id="institutional-data"]),
section:has(> h1[id="o365-adatok"]) {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    margin-top: 0 !important;
}

h1[id="általános"],
h1[id="fiókadatok-és-beállítások"],
h1[id="személyes-adatok"],
h1[id="elérhetőségek"],
h1[id="egyetemi-és-intézményi-adatok"],
h1[id="general"],
h1[id="account-settings"],
h1[id="personal-information"],
h1[id="contact-information"],
h1[id="institutional-data"],
h1[id="o365-adatok"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   9. SSH PUBLIKUS KULCS CSAK FÜGGŐLEGES ÁTMÉRETEZÉSE
   ========================================================================== */
textarea#sshPublicKey,
span.pf-v5-c-form-control.pf-m-resize-both:has(> textarea#sshPublicKey) {
    resize: vertical !important;
}


/* ==========================================================================
   10. UNIDEB PERSON STATUS - READ-ONLY NÉZET "DOBOZOSÍTVA"
   ========================================================================== */

/* 1. Teljes blokk kattinthatatlanná tétele a user számára */
.pf-v5-c-form__group:has(label[for="unidebPersonStatus"]) {
    pointer-events: none !important;
}

/* 2. ELREJTJÜK azokat a rádió gomb opciókat, amik NINCSENEK kiválasztva */
.pf-v5-c-form__group:has(label[for="unidebPersonStatus"]) .pf-v5-c-radio:not(:has(input:checked)) {
    display: none !important;
}

/* 3. A kiválasztott opciónál eltüntetjük magát a rádió "pöttyöt" (input) */
.pf-v5-c-form__group:has(label[for="unidebPersonStatus"]) .pf-v5-c-radio input[type="radio"] {
    display: none !important;
}

/* 4. A megmaradt aktív opció KONTÉNERÉNEK "dobozosítása" */
.pf-v5-c-form__group:has(label[for="unidebPersonStatus"]) .pf-v5-c-radio:has(input:checked) {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 5. A szöveg formázása a dobozon belül */
.pf-v5-c-form__group:has(label[for="unidebPersonStatus"]) .pf-v5-c-radio__label {
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #117b44 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    cursor: default !important;
    display: block !important;
}


/* ==========================================================================
   11. MODERN BEVITELI MEZŐK ÉS LEGÖRDÜLŐK (2026 Dizájn)
   Csak az AKTÍV (szerkeszthető) mezőkre vonatkozik!
   ========================================================================== */

/* --- 1. A GYÁRI SALLANGOK ELTÜNTETÉSE --- */
.pf-v5-c-form-control:not(.pf-m-disabled):not(:has(input[readonly])):not(:has(textarea[readonly]))::before,
.pf-v5-c-form-control:not(.pf-m-disabled):not(:has(input[readonly])):not(:has(textarea[readonly]))::after,
button.pf-v5-c-menu-toggle::before,
button.pf-v5-c-menu-toggle::after {
    display: none !important;
}

/* --- 2. AZ ÚJ, MODERN KONTÉNER (Doboz) DIZÁJN (Inputok és Textareák) --- */
.pf-v5-c-form-control:not(.pf-m-disabled):not(:has(input[readonly])):not(:has(textarea[readonly])) {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out !important;
    overflow: hidden !important;
}

/* FÓKUSZ ÁLLAPOT: Amikor belekattintanak az Inputba */
.pf-v5-c-form-control:not(.pf-m-disabled):not(:has(input[readonly])):not(:has(textarea[readonly])):focus-within {
    border-color: #054334 !important;
    box-shadow: 0 0 0 3px rgba(5, 67, 52, 0.15) !important;
}

/* --- 3. MAGA A BEVITELI MEZŐ BELSŐ TÉRKÖZEI --- */
.pf-v5-c-form-control input[type="text"]:not([readonly]):not([disabled]),
.pf-v5-c-form-control textarea:not([readonly]):not([disabled]) {
    padding: 10px 14px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* --- 4. MULTIVALUE CSOPORTOK TÁVOLSÁGA --- */
.pf-v5-c-input-group {
    margin-bottom: 12px !important;
    align-items: center !important;
}

/* --- 5. A "TÖRLÉS" (X) GOMB MODERNIZÁLÁSA (Aktív mezőknél) --- */
.pf-v5-c-input-group__item button[data-testid^="remove"] {
    color: #9ca3af !important;
    border-radius: 8px !important;
    margin-left: 8px !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease !important;
}

.pf-v5-c-input-group__item button[data-testid^="remove"]:hover {
    color: #dc2626 !important;
    background-color: #fee2e2 !important;
}

/* --- 6. A "HOZZÁADÁS" (Add) GOMB ÁTALAKÍTÁSA (Aktív mezőknél) --- */
button[data-testid="addValue"] {
    position: relative !important;
    width: 100% !important;
    min-height: 44px !important;
    background-color: #f8fafc !important;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 8px !important;
    margin-top: 4px !important;
    transition: all 0.2s ease !important;

    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
}

button[data-testid="addValue"] * {
    display: none !important;
}

button[data-testid="addValue"]::after {
    content: "Új elem hozzáadása" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #054334 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: block !important;
    line-height: 1 !important;
}

button[data-testid="addValue"]:hover {
    background-color: #f1f5f9 !important;
    border-color: #054334 !important;
}

/* --- 7. LEGÖRDÜLŐ MENÜK (Select / Dropdown) MODERNIZÁLÁSA --- */
button.pf-v5-c-menu-toggle {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
    width: 100% !important;
}

button.pf-v5-c-menu-toggle:focus,
button.pf-v5-c-menu-toggle.pf-m-expanded {
    border-color: #054334 !important;
    box-shadow: 0 0 0 3px rgba(5, 67, 52, 0.15) !important;
}

button.pf-v5-c-menu-toggle .pf-v5-c-menu-toggle__text {
    color: #1e293b !important;
}

/* ==========================================================================
   12. FEJLÉC MOBIL NÉZETÉNEK JAVÍTÁSA (Név és Gravatar összeragasztása)
   ========================================================================== */

/* 1. A mobilos 3-pöttyös (kebab) menü teljes és végleges elrejtése */
.pf-v5-c-toolbar__item:has(button[data-testid="options-kebab-toggle"]) {
    display: none !important;
}

/* 2. A Felhasználónév erőszakos megjelenítése mobilon is */
.pf-v5-c-toolbar__item:has(button[data-testid="options-toggle"]) {
    display: flex !important;         /* Felülírja a PatternFly mobilos elrejtését (.pf-m-hidden) */
    align-items: center !important;
    margin-left: auto !important;     /* Ez a varázsszó: Fixen a jobb szélre tolja a nevet! */
    margin-right: 8px !important;     /* Pici kulturált távolság a gravatartól */
}

/* 3. A Gravatar (Avatar) pozíciójának fixálása */
.pf-v5-c-toolbar__item:has(svg.pf-v5-c-avatar) {
    margin-left: 0 !important;        /* Garantálja, hogy rátapadjon a névre */
}

/* 4. Biztosítjuk, hogy a felső sáv flex konténere soha ne törjön új sorba */
.pf-v5-c-toolbar__content-section {
    flex-wrap: nowrap !important;
}

/* ==========================================================================
   13. JPEGPHOTO (LDAP PROFILKÉP) EGYEDI MEGJELENÍTÉSE
   ========================================================================== */

/* 1. Az esetlegesen ott maradó + / - vagy törlés gombok elrejtése a mező mellől */
.pf-v5-c-form__group:has(input[name*="jpegPhoto"]) .pf-v5-c-button,
.pf-v5-c-form__group:has(textarea[name*="jpegPhoto"]) .pf-v5-c-button {
    display: none !important;
}

/* 2. Az üres multivalue sorok elrejtése a profilképnél */
.pf-v5-c-input-group:has(input[name*="jpegPhoto"][value=""]),
.pf-v5-c-input-group:has(textarea[name*="jpegPhoto"]:empty) {
    display: none !important;
}

/* 3. A JavaScript által generált kép stílusai (Kerek, zöld keretes avatár) */
img.ud-infopark-profile-photo {
    display: block !important;
    width: 120px !important;
    height: 120px !important;
    object-fit: cover !important;        /* Hogy a kép ne torzuljon, kitöltse a kört */
    border-radius: 50% !important;       /* Teljesen kerek */
    border: 3px solid #054334 !important; /* UD INFOPARK Zöld keret */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 16px !important;
    background-color: #f8fafc !important; /* Törtfehér háttér, ha átlátszó lenne a kép */
}

/* 4. A gyári React input/textarea TELJES elrejtése, hogy ne fagyjon ki a böngésző a Base64 stringtől */
.pf-v5-c-form__group:has(input[name*="jpegPhoto"]) .pf-v5-c-form-control,
.pf-v5-c-form__group:has(textarea[name*="jpegPhoto"]) .pf-v5-c-form-control {
    display: none !important;
}

/* ==========================================================================
   14. VIZUÁLIS MASZKOK (Dátumok, Nem) KIJELÖLÉSÉNEK TILTÁSA
   ========================================================================== */
.ud-formatted-display {
    user-select: none !important;      /* Megakadályozza a szöveg kijelölését */
    -webkit-user-select: none !important; /* Safari támogatás */
    pointer-events: none !important;   /* Megakadályozza a kattintást */
}

/* ==========================================================================
   15. ATTRIBÚTUM CSOPORTOK ZAVARÓ LEÍRÁSAINAK (Nyers kulcsok) ELREJTÉSE
   ========================================================================== */
.pf-v5-c-form > p.pf-v5-u-pb-lg {
    display: none !important;
}

/* ==========================================================================
   16. GYÁRI KEYCLOAK 2FA (OTP) SZEKCIÓ VÉGLEGES ELREJTÉSE
   ========================================================================== */
section:has(> h2[id="two-factor-categ-title"]) {
    display: none !important;
}
