.upf-profile-form input[type="text"],
.upf-profile-form input[type="email"],
.upf-profile-form input[type="password"],
.upf-profile-form input[type="file"] {
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* sekce */
.upf-section {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Nadpisy sekcí */
.upf-section h3,
.upf-section h4 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #222;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 4px;
}

/* tlačítka jednotné */
.button.upf-btn {
    background: #0073aa;
    color: #fff;
    padding: 8px 14px;
    border-radius: 0;
    cursor: pointer;
    font-weight: 400;
    text-decoration: none;
    border: none;
    font-size: 1.6rem;
    display: inline-block;
    margin-top: 5px;
    text-transform: none;
}

/* stylované tlačítko pro výběr souboru (skryje název) */
.upf-file-upload {
    display: inline-block;
    padding: 6px 15px;
    background: #0073aa;
    color: #fff;
    border-radius: 0;
    cursor: pointer;
    font-weight: 400;
    position: relative;
    margin-right: 10px; /* 🔥 přidá mezírku mezi tlačítky */
}

.upf-file-upload input[type="file"] {
    display: none;
}

/* Progress bar */
#upf-upload-progress {
    width: 100%;
    background: #eee;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}
#upf-upload-progress .bar {
    height: 100%;
    width: 0;
    background: #0073aa;
    border-radius: 4px;
    transition: width 0.25s ease;
}

/* Přepínače (toggles) */
.upf-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upf-toggle {
    padding: 6px 12px;
    border: 1px solid #0073aa;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s, transform 0.06s;
    background: transparent;
    color: #0073aa;
}

.upf-toggle:active {
    transform: scale(0.98);
}

.upf-toggle input[type="checkbox"] {
    display: none;
}

.upf-toggle.active {
    background: #0073aa;
    color: #fff;
}

/* úspěch / chyba */
.upf-success { 
    color: green; 
    margin-bottom: 10px; 
    display: inline-block; 
}
.upf-error { 
    color: red; 
    margin-bottom: 10px; 
    display: inline-block; 
}

/* sekce editace profilu */
#upf-profile-edit, #upf-profile-display {
    margin-bottom: 15px;
}

#upf-password-fields {
    margin-top: 10px;
}

.entry-content .upf-section h3, 
.entry-content .upf-section h4 {
    margin-top: 0;
}

#upf-picture-preview img {
    border-radius: 50%;
}

/* === UPF success message (větší text, moderní vzhled) === */
.upf-message {
    padding: 16px 20px;
    margin-bottom: 28px;
    border-left: 5px solid #28a745;
    background-color: #f6fffa;
    border-radius: 8px;
    color: #155724;
    font-size: 1.15rem;
    line-height: 1.5;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.4s ease;
}

.upf-message::before {
    content: "✓";
    display: inline-block;
    font-weight: bold;
    color: #28a745;
    font-size: 1.5rem;
    line-height: 1;
}

/* jemná animace při zobrazení */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Seznam četby – hvězda v detailu článku === */
.upf-favorite-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.upf-favorite-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    font: inherit;
}

.upf-favorite-toggle.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Ikona seznamu četby – kniha místo hvězdy */
.upf-favorite-icon {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
    font-size: 0;
    line-height: 1;
}

.upf-favorite-icon::before,
.upf-favorite-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* neaktivní stav – prázdná kniha */
.upf-favorite-icon::before {
    opacity: 1;
    background-image: url("../img/book-inactive.png");
}

/* aktivní stav – plná kniha */
.upf-favorite-icon::after {
    opacity: 0;
    background-image: url("../img/book-active.png");
}

.upf-favorite-icon.is-favorite::before {
    opacity: 0;
}

.upf-favorite-icon.is-favorite::after {
    opacity: 1;
    transform: scale(1.03);
}

/* jemná animace i při hoveru */
.upf-favorite-toggle:hover .upf-favorite-icon::before,
.upf-favorite-toggle:hover .upf-favorite-icon::after {
    transform: scale(1.03);
}

/* === Seznam četby – seznam v profilu === */
.upf-favorites-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upf-favorites-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
    margin-left: 0 !important;
}

.upf-favorites-item:last-child {
    border-bottom: 0;
}

.upf-favorites-link {
    flex: 1 1 auto;
    text-decoration: none;
    color: #00427a !important;
}

.upf-favorites-link:hover {
    text-decoration: underline !important;
}

.upf-favorite-date {
    font-size: 1.4rem;
    color: #777;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.upf-favorite-remove {
    border: none;
    background: transparent;
    color: #999;
    font-size: 2.4rem;
    cursor: pointer;
    padding: 0 0.2rem;
    top: -1px;
    position: relative;
}

.upf-favorite-remove:hover {
    color: #d00;
}

/* === Seznam četby – popup nad hvězdou === */
/* === Seznam četby – popup nad ikonou knihy === */
.upf-favorite-popup {
    position: absolute;
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(100% + 12px);

    transform: translate(calc(-50% + var(--upf-shift-x, 0px)), 10px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    z-index: 100;

    width: min(340px, 92vw);
    text-align: center;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);

    padding: 12px 40px 12px 14px;
    font-size: 14px;
    color: #333;

    transition: opacity 0.22s ease, transform 0.22s ease;
}


/* Pokud se popup nevejde nad ikonku, zobrazí se pod ní */
.upf-favorite-popup.is-below {
    top: calc(100% + 12px);
    bottom: auto;
}

/* Mobil: popup vždy viditelný ve viewportu */
@media (max-width: 520px) {
    .upf-favorite-popup {
        position: fixed;
        left: 50%;
        top: 50%;
        bottom: auto;
        right: auto;

        transform: translate(-50%, -50%) scale(0.98);
        width: min(360px, 92vw);
        max-height: min(70vh, 520px);
        overflow-y: auto;

        z-index: 999999;
    }

    .upf-favorite-popup.is-visible {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Text uvnitř popupu */
.upf-favorite-popup-inner a {
    color: #14437c;
    text-decoration: underline;
}

.upf-favorite-popup-inner a:hover {
    text-decoration: none;
}

/* Křížek pro zavření */
.upf-favorite-popup-close {
    position: absolute;
    top: 11px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
}

.upf-favorite-popup-close:hover {
    color: #333;
}

/* Viditelný stav popupu */
.upf-favorite-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(calc(-50% + var(--upf-shift-x, 0px)), 0) scale(1);
}

/* Fáze skrývání – navazuje na animaci */
.upf-favorite-popup.is-hiding {
    animation: upfPopupFadeOut 0.35s ease forwards;
}

@keyframes upfPopupFadeOut {
    to {
        opacity: 0;
        transform: translate(calc(-50% + var(--upf-shift-x, 0px)), 10px) scale(0.96);
    }
}

