/* ===== Editor používateľa (src/pages/editor_users.php) ===== */
/* Základ (.form-kontajner, .vstupy, .image-box, .vstupny-*) je v base_style.css */

.user-editor {
    /* Jedno písmo pre stránku aj komponenty (floating-input, floating-date-input) */
    --f-font: Arial, Helvetica, sans-serif;
    font-family: var(--f-font);
    margin: 20px 0;
}

.user-editor input,
.user-editor select,
.user-editor button {
    font-family: inherit;
}

/* Popis nad výberovým zoznamom – rovnaký ako popis nad vyplneným poľom */
.user-editor .vstupny-label {
    font-size: 13px;
    font-weight: bold;
    color: #666;
    line-height: 16px;
    margin: 0;
}

/* Výberový zoznam – rovnaká výška a písmo ako textové pole */
.user-editor select.vstupny-riadok {
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    padding: 15px 0 10px 4px;
    font-size: 16px;
    line-height: 20px;
    color: #222;
    border-bottom: 1px solid #6b6b6b;
    cursor: pointer;
}

/* Blok s popisom a výberom má rovnaké okraje ako floating-input (10px hore/dole) */
.user-editor .select-field {
    margin: 10px 0;
    position: relative;
}

.user-editor .select-field .vstupny-label {
    position: absolute;
    top: -12px;
    left: 0;
}

/* Zaškrtávacie políčko v riadku s poľami */
.user-editor .user-row .custom-checkbox {
    margin: 10px 0;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.user-editor .custom-checkbox p {
    font-size: 16px;
    margin: 0;
    color: #222;
}

/* Tlačidlá v editore – menšie a rovnaké písmo */
.user-editor .button-normal {
    font-size: 16px;
    padding: 10px 22px;
}

.user-editor .button-small {
    font-size: 15px;
    line-height: 28px;
}

.user-editor [hidden] {
    display: none !important;
}

.user-editor h1.user-title {
    margin-left: 35px;
}

.user-editor .form-kontajner {
    max-width: 100%;
    box-sizing: border-box;
}

/* Panel s údajmi (predtým pevná výška 1095px) */
.user-editor .user-panel {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 20px;
    box-sizing: border-box;
    margin: 20px 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-editor .user-section-title {
    color: gray;
    margin: 14px 0 4px 0;
    font-size: 18px;
    line-height: 22px;
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    padding-bottom: 4px;
}

.user-editor .user-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.user-editor .user-row > * {
    flex: 1;
    min-width: 0;
}

.user-editor .user-row > .narrow {
    flex: 0 0 30%;
}

.user-editor .admin-only-note {
    font-size: 13px;
    line-height: 18px;
    color: #666;
    margin: 0;
}

/* Text namiesto výberu (vlastný prístup admina) – na výšku ako pole */
.user-editor .select-field .admin-only-note {
    padding: 15px 0 10px 4px;
    min-height: 45px;
    box-sizing: border-box;
}

/* Pravý stĺpec: fotka a skúsenosti */
.user-editor .profile-side {
    margin: 15px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-editor .image-box {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 20px;
    margin-top: 0;
}

.user-editor .photo-buttons {
    display: flex;
    gap: 8px;
}

.user-editor .photo-buttons .button-small {
    padding: 0 5px;
}

.user-editor .photo-buttons .danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.user-editor .experience-box {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 20px;
}

.user-editor #ex-hub {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
}

.user-editor .add-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hlásenia */
.user-editor .form-errors {
    background: rgba(255, 60, 60, 0.15);
    border-left: 5px solid red;
    border-radius: 6px;
    padding: 10px 20px;
    margin: 0 2% 20px 2%;
    color: #900;
}

.user-editor .form-errors ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.user-editor .user-flash {
    margin-left: 2%;
    padding-bottom: 10px;
    padding-top: 10px;
}

.user-editor .generated-password {
    color: #b00000;
    font-weight: bold;
    word-break: break-all;
}

.user-editor .user-buttons {
    margin: 20px 0 0 35px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Dialóg zmeny hesla */
.user-editor #heslo-popup .password-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Mobil / úzke okno --- */
@media (max-width: 800px) {
    .user-editor .form-kontajner {
        width: auto;
        margin: 0 10px;
        flex-direction: column;
    }
    .user-editor .user-panel {
        margin: 10px;
    }
    .user-editor .image-box img {
        width: 200px;
        height: 260px;
    }
    .user-editor .user-buttons {
        margin-left: 10px;
    }
}

@media (max-width: 500px) {
    .user-editor .user-row {
        flex-direction: column;
        align-items: stretch;
    }
    .user-editor .user-row > .narrow {
        flex: 1;
    }
}

/* Tlačidlo "Upraviť skúsenosti" a tlačidlá v dialógu zmeny hesla */
.user-editor .exp-edit-toggle {
    padding: 10px;
}
.user-editor .password-actions {
    margin-top: 20px;
}

/* ===== Rozloženie profilu: v strede stránky – nadpis, lišta s tlačidlami, formulár, pod ním karty ===== */
.user-editor .profile-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
.user-editor .profile-main  { min-width: 0; }
.user-editor .profile-aside { margin-top: 10px; }
.user-editor .profile-layout h1.user-title { margin-left: 0; }
.user-editor .profile-layout .user-flash,
.user-editor .profile-layout .form-errors { margin-left: 0; margin-right: 0; }
.user-editor .profile-layout .form-kontajner { width: 100%; margin: 0; }

/* Lišta s tlačidlami – ostane hore pri posúvaní */
.user-editor .profile-toolbar {
    position: sticky;
    top: 8px;
    z-index: 40;
    margin-bottom: 16px;
}
.user-editor .profile-toolbar .statement-who { align-items: center; }
.user-editor .profile-toolbar-photo {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8); background: #ddd;
}
.user-editor .profile-toolbar .statement-period { flex-wrap: wrap; justify-content: flex-end; }
/* biela zvýraznená (Uložiť) – rovnako ako v Nastaveniach */
.user-editor .statement-nav.accent { background: #fff; color: #000; font-weight: bold; }
.user-editor .statement-nav.accent:hover { background: #000; color: #fff; }
.user-editor .profile-unsaved {
    font-size: 13px; font-weight: bold; color: #4a1f00;
    background: rgba(255, 255, 255, 0.55); border-radius: 12px; padding: 4px 10px;
    animation: profile-pulse 1.6s ease-in-out infinite;
}
@keyframes profile-pulse { 50% { background: rgba(255, 255, 255, 0.9); } }
@media (prefers-reduced-motion: reduce) { .user-editor .profile-unsaved { animation: none; } }

/* Karty pod formulárom: mriežka 2 × 2 (mobil 1 stĺpec) */
.user-editor .profile-aside .profile-overview {
    grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
    align-items: stretch;
}
@media (max-width: 640px) {
    .user-editor .profile-layout { padding: 0 10px; }
    .user-editor .profile-aside .profile-overview { grid-template-columns: minmax(0, 1fr); }
    .user-editor .profile-toolbar { top: 4px; }
}

/* ===== Karty s prehľadom (src/partials/profile_overview.php) ===== */
.profile-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    font-family: Arial, Helvetica, sans-serif;
}
.profile-more summary { cursor: pointer; color: #c76f00; font-size: 0.86rem; font-weight: 600; margin: 2px 0 6px; }
.profile-more[open] summary { margin-bottom: 8px; }
.profile-card {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border-top: 3px solid #ff8800;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.profile-card-title { margin: 0 0 2px; font-size: 1.02rem; color: #222; }
.profile-big { margin: 0; font-size: 1.8rem; font-weight: 800; color: #c76f00; }
.profile-muted { margin: 0; color: #666; font-size: 0.9rem; }
.profile-muted.small { font-size: 0.8rem; }
.profile-ok { margin: 0; color: #2e7d32; font-weight: 600; font-size: 0.92rem; }
.profile-pending { margin: 0; color: #c76f00; font-weight: 600; font-size: 0.92rem; }
.profile-warn { margin: 0; color: #b71c1c; font-size: 0.9rem; }
.profile-card-actions { margin-top: auto; padding-top: 4px; }
.profile-progress { height: 10px; border-radius: 6px; background: #e3ddd5; overflow: hidden; }
.profile-progress span { display: block; height: 100%; background: linear-gradient(90deg, #ffb040, #ff8800); border-radius: 6px; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.profile-stats div { background: #fff; border-radius: 8px; padding: 6px 10px; }
.profile-stats .value { display: block; font-weight: 800; font-size: 1.1rem; color: #222; }
.profile-stats .value.minus { color: #c62828; }
.profile-stats .value.plus { color: #2e7d32; }
.profile-stats .label { font-size: 0.75rem; text-transform: uppercase; color: #777; letter-spacing: 0.4px; }
.profile-plans, .profile-logins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-plans li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; }
.profile-plans .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.profile-plans .plan-text { min-width: 0; }
.profile-plans .plan-dates { display: block; color: #555; font-size: 0.82rem; }
.profile-logins li { font-size: 0.86rem; padding: 6px 8px; border-radius: 8px; background: #fff; }
.profile-logins li.current { outline: 2px solid rgba(255, 136, 0, 0.5); }
.profile-logins .login-device { display: block; font-weight: 700; color: #333; }
.profile-logins .login-meta { color: #666; }
.profile-overview .badge {
    display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; background: #ff8800; color: #fff; vertical-align: middle;
}
.profile-overview .badge.active { background: #2e7d32; }
.profile-overview .badge.off { background: #9e9e9e; }

/* ===== Citlivý údaj (číslo OP, dátum narodenia) – skrytý, kým ho používateľ neodkryje ===== */
.sensitive-field { position: relative; flex: 1; min-width: 0; }
.sensitive-field.masked > floating-input,
.sensitive-field.masked > floating-date-input { visibility: hidden; }
.sensitive-reveal {
    position: absolute; inset: 0;
    display: none; align-items: center; gap: 10px;
    border: 0; border-bottom: 1px solid #999; background: transparent;
    font: 600 0.9rem Arial, sans-serif; color: #c76f00; cursor: pointer; text-align: left; padding: 0 4px;
}
.sensitive-reveal span { color: #555; letter-spacing: 2px; font-weight: 400; }
.sensitive-field.masked .sensitive-reveal { display: flex; }

/* ===== Kontrola pri písaní (telefón, PSČ, e-maily) – user_editor.js ===== */
.field-error { display: block; color: #c62828; font: 0.8rem Arial, sans-serif; margin: -4px 0 6px 2px; }
