/* Teljesen átlátszó hártya, homályosítás nélkül */
#szaki-panel-halyog, #szaki-hl-halyog {
    display: none; 
    position: fixed; top: 0; left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0,0); 
    z-index: 99998; 
}

/* Beúszó panel (400px széles) */
#szaki-globalis-szerkeszto, #szaki-hl-panel {
    position: fixed; top: 0; left: 0; 
    width: 400px; 
    max-width: 100vw; 
    height: 100%;
    background: var(--white); 
    border-right: 1px solid var(--border-main); 
    box-shadow: 5px 0 25px rgba(0,0,0,0.15); 
    padding: 30px 20px;
    z-index: 99999; 
    font-family: inherit; 
    box-sizing: border-box; 
    overflow-y: auto;
    transform: translateX(-105%); 
    transition: transform 0.3s ease-in-out;
}

.szaki-hl-loading { opacity: 0.5; pointer-events: none; }

#szaki-globalis-szerkeszto.nyitva, #szaki-hl-panel.nyitva {
    transform: translateX(0);
}

.szaki-dinamikus-csoport, .szaki-hl-csoport { 
    margin-bottom: 20px; 
}

.szaki-dinamikus-label, .szaki-hl-label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 400; 
    font-size: 15px; 
    color: var(--main-t-8); 
    letter-spacing: 0.5px;
}

.szaki-dinamikus-input, .szaki-hl-input { 
    width: 100%; 
    padding: 0 16px; 
    min-height:45px; 
    border: 1px solid var(--border-main); 
    background: var(--szaki-input-bg); 
    color: var(--main);  
    border-radius: 8px; 
    font-size: 15px; 
    box-sizing: border-box; 
    font-family: inherit; 
    transition: border-color 0.3s;
}

.szaki-dinamikus-input:focus, .szaki-hl-input:focus { 
    border-color: var(--brand-cta); 
    outline: none; 
}

textarea.szaki-dinamikus-input, textarea.szaki-hl-input { 
    resize: vertical; 
    min-height: 100px; 
    padding-top: 12px;
}

.szaki-hl-input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 46px !important;
        height: 24px !important;
        min-height: 24px !important;
        background: rgba(170, 170, 170, 0.3);
        border-radius: 24px;
        position: relative;
        cursor: pointer;
        outline: none;
        border: none;
        transition: background 0.3s ease;
        margin-top: 5px;
        padding: 0 !important;
    }

.szaki-hl-input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.szaki-hl-input[type="checkbox"]:checked {
    background: var(--brand-cta);
}
.szaki-hl-input[type="checkbox"]:checked::after {
        transform: translateX(22px);
    }

/* Gombok formázása */
#szaki-szerkeszto-mentes, #szaki-hl-mentes {
    background: var(--brand-cta); 
    color: var(--main-d-3); 
    border: none; 
    padding: 14px 20px; 
    border-radius: 6px; 
    width: auto; 
    font-weight: 400; 
    cursor: pointer; 
    font-size: 14px; 
    margin: 32px auto 0 auto; /* Fent 10px, Jobb auto, Lent 0, Bal auto */ 
    text-align: center; 
    display:block;
    /*transition: background-color 0.3s ease, opacity 0.2s;*/
}

#szaki-szerkeszto-mentes:hover, #szaki-hl-mentes:hover {
    background: var(--brand-cta);
    position: center;
}

#szaki-szerkeszto-megsem, #szaki-hl-megsem {
    background: transparent; 
    color: #888; 
    border: none; 
    padding: 12px 20px; 
    width: 100%; 
    margin-top: 5px; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: 400;
    text-align: center; 
    transition: color 0.3s ease;
}

#szaki-szerkeszto-megsem:hover, #szaki-hl-megsem:hover {
    color: var(--brand-cta);
}

/* Bezáró X a Headless panelhez */
#szaki-hl-bezaro-x {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    width: 32px; 
    height: 32px; 
    background: #f1f5f9; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: #333; 
    transition: background 0.2s ease;
}
#szaki-hl-bezaro-x:hover { 
    background: #e2e8f0; 
}

#szaki-hl-cim { 
    margin-top:0; 
    margin-bottom:0px; 
    color:var(--main); 
    font-size: 22px; 
    font-weight:500;
    text-align: center; 
}

.szaki-hl-alcim { 
    margin-top:8px; 
    margin-bottom:48px; 
    color:var(--main-t-6); 
    font-size: 14px; 
    font-weight: 400;
    text-align: center;
}

/*--------------------------------------------------------*/
/*        WYSIWYG teljes képernyős megjelenítése          */  
/*--------------------------------------------------------*/
/* Az "Expand" (Nagyító) gomb alapstílusa */
.szaki-wysiwyg-expand {
    position: absolute;
    top: -30px;
    right: 0;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    z-index: 10;
}
.szaki-wysiwyg-expand:hover { color: #000; }

/* ÚJ: A fizikai sötétítő réteg */
.szaki-wysiwyg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 999998;
    cursor: pointer;
}

/* A teljes képernyős mód állapota (box-shadow nélkül) */
.szaki-wysiwyg-wrapper.szaki-fullscreen-mode {
    position: fixed !important;
    top: 5vh;
    left: 5vw;
    width: 90vw;
    height: 90vh;
    z-index: 999999;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ÚJ: A Bezárás gomb stílusa teljes képernyőnél (fehér színnel a doboz felett) */
.szaki-wysiwyg-expand.szaki-is-fullscreen-btn {
    top: -35px;
    right: 0;
    color: #fff;
    font-weight: bold;
}
.szaki-wysiwyg-expand.szaki-is-fullscreen-btn:hover { color: #ddd; }

.szaki-wysiwyg-wrapper.szaki-fullscreen-mode .szaki-quill-editor {
    flex-grow: 1;
    height: auto !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* =========================================
   ÚJ: Rejtett mező teljes eltüntetése
   ========================================= */
.szaki-rejtett-mezo { display: none !important; }

/* =========================================
   ÚJ: Színválasztó (Kombinált) 
   ========================================= */
.szaki-color-selector-wrapper { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.szaki-preset-colors { display: flex; gap: 8px; }
.szaki-color-swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: transform 0.2s, border-color 0.2s; }
.szaki-color-swatch:hover { transform: scale(1.15); }
.szaki-color-swatch.active { border-color: var(--brand-cta, #5fa8b3); transform: scale(1.15); box-shadow: 0 0 0 2px rgba(95, 168, 179, 0.3); }
.szaki-custom-color-picker { display: flex; align-items: center; gap: 6px; border-left: 1px solid var(--border-main, #ccc); padding-left: 12px; }
.szaki-color-label { font-size: 13px; color: var(--main-t-8, #333); }
.szaki-color-picker-input { width: 32px; height: 32px; padding: 0; border: none; border-radius: 4px; cursor: pointer; background: none; }

/* =========================================
   SELECT2 (Kereshető Select) Dizájn 
   ========================================= */
.select2-container--default .select2-selection--single {
    height: 45px !important; border: 1px solid var(--border-main, #ccc) !important;
    background: var(--szaki-input-bg, #f9f9f9) !important; border-radius: 8px !important;
    display: flex; align-items: center; transition: border-color 0.3s;
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: var(--brand-cta, #5fa8b3) !important; outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 16px !important; color: var(--main, #000) !important; font-size: 15px !important; line-height: normal !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 43px !important; right: 10px !important; }
.select2-dropdown { border: 1px solid var(--border-main, #ccc) !important; border-radius: 8px !important; box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important; padding-bottom: 5px; }
.select2-search--dropdown .select2-search__field { border-radius: 4px !important; border: 1px solid var(--border-main, #ccc) !important; padding: 8px !important; }
.select2-search--dropdown .select2-search__field:focus { border-color: var(--brand-cta, #5fa8b3) !important; outline: none; }
.select2-results__option--highlighted[aria-selected] { background-color: var(--brand-cta, #5fa8b3) !important; }

/* =========================================
   MULTISELECT (Pirulák) Dizájn
   ========================================= */
.select2-container--default .select2-selection--multiple {
    min-height: 45px !important; border: 1px solid var(--border-main, #ccc) !important;
    background: var(--szaki-input-bg, #f9f9f9) !important; border-radius: 8px !important;
    display: flex; align-items: center; padding: 4px 8px; flex-wrap: wrap;
}
.select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--brand-cta, #5fa8b3) !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--brand-cta, #5fa8b3) !important; border: none !important; color: #fff !important;
    border-radius: 4px !important; padding: 4px 8px !important; margin-top: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #fff !important; margin-right: 5px; border: none; font-weight: bold; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { background: transparent !important; color: #ffcccc !important; }

/* =========================================
   VALIDÁCIÓS HIBAJELZÉS (Rázkódó animáció)
   ========================================= */
.szaki-hiba-mezo, .szaki-hiba-mezo + .select2-container .select2-selection {
    border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important; animation: szaki-shake 0.4s ease-in-out;
}
.szaki-quill-editor.szaki-hiba-mezo, .szaki-dropzone.szaki-hiba-mezo { border: 1px solid #ef4444 !important; }
@keyframes szaki-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}