/* =========================================================
   Elektronická úřední deska – styl_ud.css
   Design sjednocen s eupraha.cz (Mgr. Jan Škarpa)
   Primární barva: #1f5e8c | Fonty: Source Sans 3 / Libre Baskerville
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #f0f4f8;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #1a1a1a;
}

a {
    color: #1f5e8c;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #174d75;
    text-decoration: underline;
}

/* ── Hlavní kontejner ──────────────────────────────────── */
.box_normal {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 16px auto 28px auto;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    overflow: visible;
}

.box_normal h3 {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1.35rem;
    color: #1f5e8c;
    margin-bottom: 8px;
    text-align: center;
}

.box_normal h4 {
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    margin-top: 0;
    margin-bottom: 16px;
}

.box_normal p {
    line-height: 1.65;
    color: #444;
}

/* Info box – text z databáze (informace) */
.info-box {
    border: 1px solid #c5d5e4;
    border-left: 4px solid #1f5e8c;
    background: #f4f8fc;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 12px;
}

.info-box p {
    margin: 1px 0;
    line-height: 1.5;
}

/* ── Lišta vyhledávání / filtrace ─────────────────────── */
#hledani {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    background-color: #1f5e8c;
    padding: 8px 12px;
    color: #ffffff;
    border-radius: 6px;
    margin-bottom: 4px;
    min-height: 48px;
}

#hledani a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.5em;
    margin-right: 12px;
    line-height: 1;
    transition: opacity 0.2s;
}

#hledani a:hover {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.75;
}

#hledani select,
#hledani option {
    font-size: 0.85em;
    padding: 4px 6px;
    background: #174d75;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#hledani2 {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    background-color: #1f5e8c;
    padding: 8px 12px;
    color: #ffffff;
    border-radius: 6px;
    margin-bottom: 20px;
    min-height: 48px;
}

#hledani2 a {
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    margin-right: 12px;
    transition: opacity 0.2s;
}

#hledani2 a:hover {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.75;
}

#hledani2 span {
    font-size: 0.95em;
    font-weight: 600;
}

#hledani2 select,
#hledani2 option {
    padding: 4px 6px;
}

/* ── Štítky vyhledávání / filtrace ────────────────────── */
.vyhledavani {
    float: left;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 2em;
}

.filtrace {
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 2em;
    margin-left: auto;
}

#uredni_deska_roller {
    padding: 0;
}

/* ── Formulář vyhledávání ──────────────────────────────── */
#uredni_deska_vyhledavani {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    float: left;
    margin-left: 8px;
}

#uredni_deska_vyhledavani input[type="text"] {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: #ffffff;
    padding: 4px 10px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 0.9em;
    outline: none;
    transition: background 0.2s, border-color 0.2s;
}

#uredni_deska_vyhledavani input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#uredni_deska_vyhledavani input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.85);
}

#uredni_deska_vyhledavani input[type="submit"] {
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #1f5e8c;
    font-weight: 700;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 0.85em;
    padding: 4px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#uredni_deska_vyhledavani input[type="submit"]:hover {
    background: #174d75;
    border-color: #174d75;
    color: #ffffff;
}

/* ── Tabulka úřední desky ──────────────────────────────── */
#uredni_deska {
    background-color: #ffffff;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 13.5px;
    border-radius: 6px;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    overflow-x: auto;
}

#uredni_deska table,
#uredni_deska tr,
#uredni_deska td,
#uredni_deska th {
    border: 0 none;
    border-collapse: collapse;
}

#uredni_deska_cela {
    width: 100%;
    border-collapse: collapse;
}

/* Záhlaví tabulky */
#uredni_deska_zahlavi td {
    padding: 10px 10px 10px 8px;
    font-weight: 700;
    font-size: 13px;
    background-color: #1f5e8c;
    color: #ffffff;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 0;
}

/* Standardní řádek */
#uredni_deska_radek td {
    padding: 8px;
    border-bottom: 1px solid #e8edf2;
    vertical-align: top;
    line-height: 1.45;
}

#uredni_deska_radek:nth-child(even) {
    background-color: #f4f7fa;
}

#uredni_deska_radek:hover {
    background-color: #dce8f2;
    transition: background-color 0.15s;
}

/* Zvýrazněný řádek (OST apod.) */
#uredni_deska_radek_special {
    background: #e8f0f8;
    color: #1a1a1a;
    border-left: 3px solid #1f5e8c;
}

#uredni_deska_radek_special td {
    padding: 8px;
    border-bottom: 1px solid #c5d9ec;
    vertical-align: top;
    line-height: 1.45;
}

#uredni_deska_radek_special:hover {
    background-color: #d0e2f0;
    transition: background-color 0.15s;
}

/* Tlačítko Otevřít */
input.vyveska[type="submit"] {
    background: #1f5e8c;
    border: 1px solid #1f5e8c;
    color: #ffffff;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

input.vyveska[type="submit"]:hover {
    background: #174d75;
    border-color: #174d75;
}

/* ── PDF tlačítka ──────────────────────────────────────── */

/* Buňka s PDF tlačítky – grid max 3 na řádek */
.pdf-cell {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 4px;
}

/* Základní styl tlačítka */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1f5e8c;
    color: #ffffff !important;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 4px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-pdf:hover {
    background: #174d75;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Více PDF v buňce – jen ikonka, menší padding */
.pdf-cell .btn-pdf:not(:only-child) {
    padding: 3px 7px;
}

.pdf-cell .btn-pdf:not(:only-child) .btn-text {
    display: none;
}

.pdf-cell .btn-pdf:not(:only-child) svg {
    width: 15px;
    height: 15px;
}

/* ── Detail (vyzva / sdeleni / oznameni) ───────────────── */
.detail-meta {
    display: block;
    width: 100%;
    font-size: 14.5px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    margin-top: 20px;
    margin-bottom: 20px;
    line-height: 1.65;
}

.detail-meta table {
    border-collapse: collapse;
    width: 100%;
}

.detail-meta td {
    padding: 6px 10px 6px 0;
    border-bottom: 1px solid #e8edf2;
    vertical-align: top;
}

.detail-meta td:first-child {
    color: #555;
    font-size: 0.9em;
    white-space: nowrap;
    width: 200px;
}

/* ── Stránkování ───────────────────────────────────────── */
.strankovani {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 18px;
    font-size: 12.5px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    text-align: left;
    overflow: hidden;
}

.strankovani p {
    color: #666;
    margin: 0 0 8px 0;
    font-size: 12px;
}

.strankovani a {
    float: left;
    text-decoration: none;
    border: 1px solid #c5d5e4;
    padding: 5px 11px;
    margin-right: 4px;
    margin-bottom: 4px;
    font-weight: 600;
    color: #1f5e8c;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.strankovani a:hover {
    color: #ffffff;
    border-color: #1f5e8c;
    background: #1f5e8c;
}

/* Aktivní stránka (inline style z PHP) */
.strankovani a[style*="background-color: #000000"] {
    background-color: #1f5e8c !important;
    color: #ffffff !important;
    border-color: #1f5e8c !important;
}

/* ── Přihlášení ────────────────────────────────────────── */
#prihlaseni {
    position: relative;
    margin: 200px auto 0 auto;
    width: 360px;
    padding: 32px 28px 24px 28px;
    background: #ffffff;
    border: 1px solid #dce8f2;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(31, 94, 140, 0.1);
    text-align: center;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
}

#prihlaseni input {
    border-radius: 6px;
    text-align: center;
    border: 1px solid #c5d5e4;
    padding: 8px 12px;
    width: 100%;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    transition: border-color 0.2s;
}

#prihlaseni input:focus {
    border-color: #1f5e8c;
    outline: none;
}

#prihlaseni label {
    display: block;
    margin: 6px 0 4px 0;
    color: #444;
    font-size: 0.9em;
    font-weight: 600;
}

/* ── Oznámení (flash zpráva) ───────────────────────────── */
#oznameni {
    position: relative;
    top: 0;
    width: auto;
    max-width: 480px;
    margin: 20px auto;
    background: #ffffff;
    border: 2px solid #1f5e8c;
    box-shadow: 0 4px 12px rgba(31, 94, 140, 0.15);
    border-radius: 8px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px;
    color: #1f5e8c;
    text-align: center;
}

/* ── Formuláře (nastavení, editace, import) ────────────── */
#nastaveni input,
#editace input,
#ceditace input,
#import input {
    width: 95%;
    margin: 8px 10px;
    padding: 9px 10px;
    border: 1px solid #c5d5e4;
    border-radius: 6px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
}

#nastaveni input:focus,
#editace input:focus,
#ceditace input:focus,
#import input:focus {
    border-color: #1f5e8c;
    outline: none;
}

#nastaveni textarea {
    width: 95%;
    margin: 8px 10px;
    padding: 9px 10px;
    border: 1px solid #c5d5e4;
    border-radius: 6px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

#nastaveni textarea:focus {
    border-color: #1f5e8c;
    outline: none;
}

#nastaveni label,
#editace label,
#ceditace label,
#import label {
    float: left;
    width: 100%;
    font-weight: 700;
    font-size: 13px;
    color: #444;
    margin-left: 10px;
    margin-top: 10px;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
}

#form_button,
#editace button,
#import button,
#ceditace button {
    width: 95%;
    margin: 10px;
    padding: 10px 0;
    font-weight: 700;
    font-family: 'Source Sans 3', system-ui, Arial, sans-serif;
    font-size: 14px;
    background: #1f5e8c;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

#form_button:hover,
#editace button:hover,
#import button:hover,
#ceditace button:hover {
    background: #174d75;
}

#ciselnik {
    width: 95%;
    margin: 10px;
    padding: 9px 10px;
}

/* ── Responzivita ──────────────────────────────────────── */
@media (max-width: 768px) {
    .box_normal {
        padding: 14px 12px;
        border-radius: 0;
        box-shadow: none;
    }

    #hledani,
    #hledani2 {
        flex-wrap: wrap;
        height: auto;
        gap: 6px;
    }

    #uredni_deska_vyhledavani {
        width: 100%;
        float: none;
        margin-left: 0;
    }

    #uredni_deska_vyhledavani input[type="text"] {
        width: 100%;
    }

    .detail-meta td:first-child {
        width: 130px;
    }

    #prihlaseni {
        width: 92%;
        margin-top: 60px;
    }

    .pdf-cell {
        grid-template-columns: repeat(2, auto);
    }
}
