/* ============================================================
   Zápisy ze schůze – Custom styles
   ============================================================ */

/* App icon on login page */
.app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #0d6efd, #0a3d8f);
    border-radius: 20px;
    color: white;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.35);
}

/* Smooth transitions */
.btn, .form-control, .form-check-input {
    transition: all 0.15s ease;
}

/* Member list rows */
.member-row {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    transition: background 0.1s;
}
.member-row:hover {
    background: #f8f9fa;
}

/* Presence toggle custom styling */
.form-check-input[type="checkbox"].presence-toggle {
    width: 2.4em;
    height: 1.3em;
    cursor: pointer;
}

/* Excuse field animation */
.excuse-field {
    transition: opacity 0.2s;
}
.excuse-field.d-none {
    opacity: 0;
}

/* Agenda item cards */
.agenda-item {
    background: #fff;
    border-radius: 0;
}
.agenda-item:last-child {
    border-bottom: none !important;
}

/* Agenda number badge on view page */
.agenda-number {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Card headers */
.card-header {
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

/* Responsive navbar brand */
@media (max-width: 400px) {
    .navbar-brand {
        font-size: 0.9rem;
    }
}

/* Focus ring visibility */
:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

/* Bottom padding for forms (avoids content hidden behind mobile browser UI) */
form {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Dashboard table hover color */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* Guest row remove button */
.btn-remove-guest {
    min-width: 42px;
}

/* Print view – hide non-essential on small screens */
@media (max-width: 576px) {
    .d-sm-none-custom { display: none; }
}

/* Sticky bottom submit bar on mobile */
@media (max-width: 768px) {
    .form-sticky-bottom {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 12px 0;
        border-top: 1px solid #dee2e6;
        z-index: 10;
    }
}

/* ── Sdílený rich-text editor (richtext.js / richtext.php) ─────────────────── */
.rte {
    min-height: 6rem; border: 1px solid var(--bs-border-color);
    border-radius: .375rem; padding: .5rem .75rem;
    background: var(--bs-body-bg); color: var(--bs-body-color);
    overflow-y: auto; line-height: 1.5;
}
.rte.rte-sm { min-height: 3.5rem; }
.rte:focus { outline: 0; border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15); }
.rte:empty:before { content: attr(data-placeholder); color: var(--bs-secondary-color); }

/* Toolbar je MIMO tok stránky (absolute) — plave nad aktivním polem. Tím se při
   zaostření/odostření editoru neposouvá okolní obsah (dřív sticky verze odsouvala
   pole o svou výšku) a zároveň zůstává u pole i při scrollu. Pozici (top/left/width)
   nastavuje richtext.js podle právě upravovaného pole. */
.rt-toolbar {
    display: none; position: absolute; top: 0; left: 0;
    flex-wrap: wrap; gap: .25rem; z-index: 1035;
    padding: .35rem .5rem; border: 1px solid var(--bs-border-color); border-radius: .375rem;
    background: var(--bs-tertiary-bg); box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.rt-toolbar.show { display: flex; }
.rt-toolbar .btn { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .45rem; }
.rt-toolbar .form-select-sm { --bs-form-select-padding-y: .15rem; padding-top: .15rem; padding-bottom: .15rem; }

/* Společný vzhled formátovaného obsahu v editoru i při zobrazení */
.rte > :first-child, .rt-content > :first-child { margin-top: 0; }
.rte > :last-child, .rt-content > :last-child { margin-bottom: 0; }
.rte h1, .rt-content h1 { font-size: 1.5rem; }
.rte h2, .rt-content h2 { font-size: 1.3rem; }
.rte h3, .rt-content h3 { font-size: 1.1rem; }
.rte blockquote, .rt-content blockquote {
    border-left: 3px solid var(--bs-border-color); padding-left: .75rem;
    color: var(--bs-secondary-color); margin: .5rem 0;
}
.rte ul, .rte ol, .rt-content ul, .rt-content ol { padding-left: 1.6rem; margin-bottom: .5rem; }
.rte pre, .rt-content pre {
    position: relative; background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color); border-radius: .375rem;
    padding: .6rem .75rem; margin: .5rem 0; overflow-x: auto;
    font-family: var(--bs-font-monospace, monospace); font-size: .875em;
}
.rte pre code, .rt-content pre code { background: none; padding: 0; white-space: pre-wrap; }
.rt-content pre.rt-code { padding-right: 2.5rem; }
.rt-copy-btn {
    position: absolute; top: .35rem; right: .35rem;
    border: 1px solid var(--bs-border-color); border-radius: .3rem;
    background: var(--bs-body-bg); color: var(--bs-secondary-color);
    line-height: 1; padding: .2rem .4rem; cursor: pointer; font-size: .8rem;
}
.rt-copy-btn:hover { color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
