/* ----------------------------------------
    ClearCheck Template Library
------------------------------------------ */

/* Template card */

.template-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    padding: 10px 16px;
    border: 1px solid var(--l-gray6);
    border-radius: 4px;
    cursor: pointer;
    transition:
        border-color var(--l-quarter),
        background var(--l-quarter);
}

.template-card:hover {
    border-color: var(--l-blue3);
    background: var(--l-gray9);
}

.template-card > i:first-child {
    font-size: 1.5em;
    color: #db615c;
    flex-shrink: 0;
}

.template-card > h5 {
    margin: 0;
    flex: 1;
    min-width: 0;
    color: #42525c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card-download,
.template-card-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--l-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.template-card-download:hover,
.template-card-preview:hover {
    color: var(--l-blue1, #23527c);
    text-decoration: none;
}

.template-card-download i,
.template-card-preview i {
    font-size: 14px;
}

/* Preview modal header */

#templatePreviewModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 10px 15px;
}

#templatePreviewModal .modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#templatePreviewModal .modal-header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Preview modal */

#templatePreviewModal {
    border: none;
    border-radius: 6px;
    padding: 0;
    width: 75vw;
    max-width: calc(100vw - 40px);
    max-height: 85vh;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

#templatePreviewModal .modal-dialog {
    margin: 0;
    width: 100%;
    height: 100%;
}

#templatePreviewModal .modal-content {
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

#templatePreviewModal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

#templatePreviewModal .modal-body {
    max-height: 75vh;
    overflow-y: auto;
    padding: 24px;
}

#constraintsTable th,
#constraintsTable td,
#prescriptionsTable th,
#prescriptionsTable td {
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 10px;
}

#constraintsTable td:nth-child(7) {
    font-family: monospace;
}

#prescriptionsTitle,
#constraintsTitle {
    margin-bottom: 12px;
}

#templatePreviewLoading {
    padding: 40px;
}

#eclipsePrescriptionNote {
    margin-bottom: 12px;
}

#templatePreviewNotes {
    padding: 12px 16px;
    background: var(--l-gray9, #f5f5f5);
    border: 1px solid var(--l-gray6, #ddd);
    border-radius: 4px;
}

#templatePreviewNotes h5 {
    margin: 0 0 6px;
}

#templatePreviewNotes p {
    margin: 0;
    white-space: pre-wrap;
}
