/* ════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 18px;
    line-height: 1.5;
    border-left: 3px solid transparent;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border-left-color: var(--error);
}

.auth-card .alert-error {
    background: rgba(185, 28, 28, 0.12);
    color: #f87171;
    border-left-color: #f87171;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-left-color: var(--success);
}

.auth-card .alert-success {
    background: rgba(45, 122, 79, 0.12);
    color: #6ee7b7;
    border-left-color: #6ee7b7;
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-left-color: var(--info);
}

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 22px;
    margin-bottom: 14px;
    transition: box-shadow var(--duration) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.excuse-card.excuse-active {
    border-color: rgba(34, 197, 94, 0.3);
}

/* ════════════════════════════════════════
   FEED
   ════════════════════════════════════════ */

.feed-container {
    max-width: 620px;
    margin: 0 auto;
}

.feed-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.feed-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-header h1::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--crimson);
    border-radius: 2px;
    display: inline-block;
}

.feed-welcome {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
    padding-left: 14px;
}

/* ════════════════════════════════════════
   POST FORM
   ════════════════════════════════════════ */

.post-form-card {
    padding: 16px 18px;
}

.post-form-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.post-form-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--crimson-glow);
    color: var(--crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    overflow: hidden;
}

.post-form-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text);
    resize: none;
    outline: none;
    line-height: 1.5;
    padding: 8px 0;
    min-height: 40px;
}

.post-input::placeholder {
    color: var(--ash);
}

.post-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* Sdílet doprava — dřív to zajišťoval .file-preview s flex:1,
   který nahradil .attach-strip mimo tento řádek */
.post-form-actions button[type="submit"] {
    margin-left: auto;
}

.btn-upload {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}

.btn-upload:hover {
    color: var(--crimson);
    background: var(--crimson-glow);
}

.file-preview {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.force-notify-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--duration-fast);
}

.force-notify-toggle input {
    display: none;
}

.force-notify-toggle:hover {
    color: var(--crimson);
    background: var(--crimson-glow);
}

.force-notify-toggle:has(input:checked) {
    color: var(--crimson);
    background: var(--crimson-glow);
}

/* Kontakty členů */
.contact-list {
    padding: 0;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.contact-detail {
    font-size: 0.8125rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.contact-detail a {
    color: var(--crimson);
    text-decoration: none;
}

/* Jméno + avatar vedou na profil člena */
.contact-link { display: flex; flex-shrink: 0; }

.contact-name-link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.contact-belt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    white-space: nowrap;
}

.contact-chevron {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--ash);
    opacity: 0.6;
}

/* Člen bez vyplněných kontaktů — zašedlý, jen informativní řádek */
.contact-row-empty .contact-avatar {
    filter: grayscale(1);
    opacity: 0.5;
}

.contact-row-empty .contact-name {
    color: var(--text-muted);
    font-weight: 500;
}

.contact-row-empty .contact-detail {
    color: var(--ash);
    font-style: italic;
}

/* Push re-aktivace banner (notify_push=1, ale toto zařízení bez subscription) */
.push-reactivate {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--crimson-glow);
    border: 1px solid var(--crimson-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}
.push-reactivate > svg { color: var(--crimson); flex-shrink: 0; }
.push-reactivate-text { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--text); }
.push-reactivate .btn { flex-shrink: 0; }
.push-reactivate-x { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; flex-shrink: 0; }

/* Generický náhled příloh (chipy s ×) — feed, komentáře */
.attach-strip { display: none; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-chip {
    position: relative; width: 56px; height: 56px; border-radius: 8px;
    overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.attach-chip img { width: 100%; height: 100%; object-fit: cover; }
.attach-chip-file { font-size: 0.55rem; padding: 4px; text-align: center; color: var(--text-muted); word-break: break-all; overflow: hidden; }
.attach-chip-x {
    position: absolute; top: 0; right: 0; width: 18px; height: 18px;
    background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 0 8px 0 8px;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ════════════════════════════════════════
   VYHLEDÁVÁNÍ
   ════════════════════════════════════════ */
.search-page { max-width: 640px; margin: 0 auto; }
.search-page h1 { font-size: 1.4rem; margin-bottom: 14px; }
.search-input {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    -webkit-appearance: none;
    outline: none;
    margin-bottom: 10px;
}
.search-input:focus { border-color: var(--crimson); box-shadow: 0 0 0 3px var(--crimson-glow); }
.search-hint { color: var(--text-muted); font-size: 0.875rem; padding: 6px 2px; }
.search-group-title {
    font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 18px 0 8px;
}
.search-group { display: flex; flex-direction: column; gap: 4px; }
.search-hit {
    display: flex; gap: 10px; align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}
.search-hit:hover { background: var(--bg-alt); }
.search-hit-avatar { width: 34px; height: 34px; border-radius: var(--radius-full); object-fit: cover; flex-shrink: 0; }
.search-hit-body { min-width: 0; flex: 1; }
.search-hit-title { font-weight: 600; font-size: 0.9rem; }
.search-hit-text { font-size: 0.85rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.search-hit mark { background: var(--crimson-glow); color: var(--crimson); border-radius: 3px; padding: 0 1px; }

/* Bublina se jménem po kliknutí na avatar (kpdShowNameTip v app.js).
   Fixed pozice — nesmí ji ořezat karta ani scroll kontejner. */
.kpd-nametip {
    position: fixed;
    z-index: 1200;
    max-width: 240px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--rice);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                visibility var(--duration-fast);
}
.kpd-nametip.open { opacity: 1; visibility: visible; transform: translateY(0); }

/* Avatar reagující na klik — jasně signalizovat, že se dá ťuknout. */
[data-uname] { cursor: pointer; }
