/* components.css */

.button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.button {
    padding: 6px 12px;
    margin-right: 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: var(--color-accent);
    text-decoration: none;
    color: #000;
    transition: background-color 0.2s, color 0.2s;
    font-weight: bold;
}

.button:last-child {
    margin-right: 0;
}

.button:hover {
    background-color: #e6aa00;
    color: #000;
}

.button.active {
    background-color: var(--color-alert);
    color: white;
    border-color: var(--color-alert);
}

.alergen-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: #000;
    text-align: center;
    font-weight: bold;
    margin: 2px;
    font-size: 14px;
    border: 1px solid #aaa;
    cursor: help;
}

.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    width: 50%;
    max-width: 550px;
    border-radius: 8px;
    font-family: var(--font-default);
}

.btn-save,
.btn-cancel,
.btn-add,
.btn-refresh,
.btn-edit,
.btn-delete,
.btn-price,
.btn-select,
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-default);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1.2;
    height: 42px;
}

.btn-save {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.btn-save i {
    color: var(--color-primary);
}

.btn-save:hover {
    background-color: #e6aa00;
}

.btn-cancel {
    background-color: var(--color-alert);
    color: #fff;
}

.btn-cancel:hover {
    background-color: #d13c50;
}

.btn-add {
    background-color: var(--color-primary);
    color: white;
}

.btn-add:hover {
    background-color: #155c6c;
}

.btn-refresh {
    background-color: #ccc;
    color: #333;
}

.btn-refresh:hover {
    background-color: #bbb;
}

.btn-edit {
    background-color: transparent;
    color: var(--color-primary);
    padding: 6px;
}

.btn-edit:hover {
    color: #0f6b7e;
}

.btn-delete {
    background-color: transparent;
    color: var(--color-alert);
    padding: 6px;
}

.btn-delete:hover {
    color: #b52b3f;
}

.btn-price {
    background-color: transparent;
    color: #ffc107;
    padding: 6px;
}

.btn-price:hover {
    color: #e0a800;
}

.btn-select,
.btn-submit {
    background-color: #f8f9fa;
    color: var(--color-primary);
    border: 1px solid #ccc;
}

.btn-select:hover,
.btn-submit:hover {
    background-color: #e2e6ea;
}

.ui-autocomplete {
    z-index: 2000; /* nebo víc, pokud je dialog výš */
}

.ui-autocomplete {
    z-index: 3000 !important; /* musí být nad .dialog, která má 1000 */
    position: absolute;       /* pro jistotu */
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.ui-autocomplete li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.ui-autocomplete li:last-child {
    border-bottom: none;
}

.ui-autocomplete li:hover {
    background-color: #f2f2f2;
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
}

.autocomplete-title {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

.autocomplete-sub {
    font-size: 0.85rem;
    color: #777;
}

.public-note {
    margin-top: 10px;
    padding: 10px;
    background-color: #f6f6f6;
    border-left: 4px solid var(--color-primary);
    font-style: italic;
    color: #444;
    border-radius: 4px;
    font-size: 0.95rem;
}

#banner {
    text-align: center;
    margin-bottom: 20px;
}

.single-establishment {
    color: var(--color-primary);
    font-size: 1.8rem;
    margin-top: 10px;
}

.no-est {
    color: var(--color-alert);
    font-size: 2rem;
    font-weight: bold;
}

.no-est-sub {
    font-style: italic;
    color: #666;
    margin-top: 5px;
    font-size: 1rem;
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    height: 42px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-default);
    text-decoration: none;
    background-color: #f8f9fa;
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-toggle:hover {
    background-color: #e2e6ea;
}

.btn-toggle.active {
    background-color: var(--color-alert);
    color: white;
    border-color: var(--color-alert);
}

.btn-toggle.active:hover {
    background-color: #d13c50;
}

.table-legend {
    margin-top: 20px;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95em;
    color: #444;
    position: relative;
    z-index: 1;
}

.table-legend h3 {
    margin-top: 0;
    font-size: 1.1em;
}

.table-legend ul {
    padding-left: 20px;
}

.checkbox-list label {
    display: inline-block;
    margin: 4px 12px 4px 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.checkbox-grid label {
    font-weight: normal;
    color: #000;
}

.text-success {
  color: var(--color-success);
}
.text-danger {
  color: var(--color-alert);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (max-width: 600px) {
    .dialog {
        position: fixed;
        top: 50%;
        left: 2px;
        right: 2px;
        transform: translateY(-50%);
        margin: 0 auto;
        width: auto;
        max-width: none;
        padding: 16px;
        box-sizing: border-box;
    }
}

@media (min-width: 601px) and (max-width: 992px) {
    .dialog {
        position: fixed;
        top: 50%;
        left: 15%;
        right: 15%;
        transform: translateY(-50%);
        margin: 0 auto;
        width: auto;
        max-width: none;
        padding: 16px;
        box-sizing: border-box;
    }
}

@media (min-width: 600px) {
    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
    }
}
