/* Template Editor Admin Page */

.template-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #dee2e6;
}

.template-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.variable-hint {
    background-color: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem 0;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    color: #0056b3;
}

.variable-hint code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-family: monospace;
}

.template-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.template-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.template-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.template-header {
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.template-header h5 {
    margin: 0;
    color: #0d6efd;
    font-weight: 600;
}

.template-textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    resize: vertical;
}

.template-textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.preview-section {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
}

.preview-toggle {
    font-weight: 500;
    color: #495057;
    user-select: none;
    padding: 0.5rem;
}

.preview-toggle:hover {
    color: #0d6efd;
}

.preview-box {
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.template-actions .btn {
    flex: 1;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-control {
    border-color: #dee2e6;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .template-group {
        grid-template-columns: 1fr;
    }

    .template-card {
        padding: 1rem;
    }

    .preview-box {
        font-size: 0.85rem;
    }
}
