/* ========================================
   HEALTH ENTRY MODAL - Zapsat zdravotní test
   Komponenta (BEM, MOBILE FIRST)
   ======================================== */

.health-entry-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.health-entry-modal__inner {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---- Header ---- */
.health-entry-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.health-entry-modal__title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.health-entry-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s;
}

.health-entry-modal__close:hover {
    color: #374151;
}

/* ---- Body ---- */
.health-entry-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ---- Field ---- */
.health-entry-modal__field {
    margin-bottom: 16px;
}

.health-entry-modal__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.health-entry-modal__input,
.health-entry-modal__select,
.health-entry-modal__textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    color: #1a1a2e;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.health-entry-modal__select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.health-entry-modal__textarea {
    resize: vertical;
    min-height: 60px;
}

.health-entry-modal__input:focus,
.health-entry-modal__select:focus,
.health-entry-modal__textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

/* ---- Chybějící povinné pole ---- */
.health-entry-modal__field--error .health-entry-modal__input,
.health-entry-modal__field--error .health-entry-modal__select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.health-entry-modal__field--error .health-entry-modal__label {
    color: #dc2626;
}

.health-entry-modal__field--error .health-entry-modal__category-grid {
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 4px;
}

.health-entry-modal__field--error .health-entry-modal__status-grid {
    border: 2px solid #dc2626;
    border-radius: 12px;
    padding: 4px;
}

/* Custom select wrapper - error */
.health-entry-modal__field--error .custom-select__trigger {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.health-entry-modal__hint {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ---- Kategorie grid ---- */
.health-entry-modal__category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.health-entry-modal__category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.health-entry-modal__category-btn:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.health-entry-modal__category-btn--active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}

/* ---- Status grid (hodnoceni vysledku) ---- */
.health-entry-modal__status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.health-entry-modal__status-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.health-entry-modal__status-btn:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.health-entry-modal__status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-entry-modal__status-dot--ok { background: #16a34a; }
.health-entry-modal__status-dot--warning { background: #f59e0b; }
.health-entry-modal__status-dot--error { background: #dc2626; }

.health-entry-modal__status-btn--active {
    font-weight: 600;
}

.health-entry-modal__status-btn--active[data-status="ok"] {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.health-entry-modal__status-btn--active[data-status="warning"] {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.health-entry-modal__status-btn--active[data-status="error"] {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

/* ---- Upload ---- */
.health-entry-modal__upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.15s;
}

.health-entry-modal__upload:hover {
    border-color: #f97316;
    background: #fff7ed;
}

.health-entry-modal__upload--dragover {
    border-color: #f97316;
    background: #fff7ed;
}

.health-entry-modal__upload svg {
    width: 28px;
    height: 28px;
    color: #9ca3af;
}

.health-entry-modal__upload-text {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.health-entry-modal__upload-hint {
    font-size: 11px;
    color: #9ca3af;
}

.health-entry-modal__upload-input {
    display: none;
}

/* Upload preview */
.health-entry-modal__upload-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
}

.health-entry-modal__upload-preview svg {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex-shrink: 0;
}

.health-entry-modal__upload-filename {
    flex: 1;
    font-size: 13px;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-entry-modal__upload-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.health-entry-modal__upload-remove:hover {
    color: #dc2626;
}

/* ---- Actions ---- */
.health-entry-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
}

.health-entry-modal__cancel {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #6b7280;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.health-entry-modal__cancel:hover {
    background: #e5e7eb;
}

.health-entry-modal__submit {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #f97316;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.health-entry-modal__submit:hover {
    background: #ea580c;
}

/* ========================================
   TABLET (768px+)
   ======================================== */
@media (min-width: 768px) {
    .health-entry-modal__category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .health-entry-modal__status-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
